in_time_scope 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf64f421102e871af6a7dc8cb3299d027baab7a43a8db7a8cac7d0652356628a
4
- data.tar.gz: b21727c22eda667f0aba90e84a4a1ede84191a612c105a4fd4d1cf8713ec3718
3
+ metadata.gz: 7ae5a251a71cec0f0ad9ac7890d9e1e88de46dade545cbfcff2cf0201d603939
4
+ data.tar.gz: 9a4c17e7f1ad5a1b62ebf37038332d43a7610fcce5f770e66df70e51670dc415
5
5
  SHA512:
6
- metadata.gz: e2df0f634c6ffd4e2929ff40775916fdedc4a52bc60399a322eeb0fbb40371adb37a62f27ce7742dae5c245c870ebf9376c08dd20bea5ea3dfa2a0a1786e470d
7
- data.tar.gz: '08314bae4f6641237320af99c52ae039a6f65888113ac74e32ba07434893ed8a97124209d60baacb02487c693fe37c9da458a953d83105c58998c8517931d092'
6
+ metadata.gz: 4480bbfaee296c29a87e96b26c2f32f29a78792712765cb48b51699c01bc552526ab1764972bd6cb19bfa4ce5de115abd099a7d0abf8701a26fa69eedc780d6e
7
+ data.tar.gz: b905e3bf65da95f7b4868e49c386051616b071cd67de613617d0443caa4679cbb4cc0c729ca9b6ec2776a32af4cfda32deedd48d61ceca4d326c833748b382a4
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InTimeScope
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/in_time_scope.rb CHANGED
@@ -15,19 +15,18 @@ module InTimeScope
15
15
  scope_name ||= :in_time
16
16
  scope_prefix = scope_name == :in_time ? "" : "#{scope_name}_"
17
17
 
18
- start_config = normalize_config(start_at, :"#{scope_prefix}start_at", :start_at)
19
- end_config = normalize_config(end_at, :"#{scope_prefix}end_at", :end_at)
18
+ start_config = normalize_config(start_at, :"#{scope_prefix}start_at")
19
+ end_config = normalize_config(end_at, :"#{scope_prefix}end_at")
20
20
 
21
21
  define_scope_methods(scope_name, start_config, end_config, prefix)
22
22
  end
23
23
 
24
24
  private
25
25
 
26
- def normalize_config(config, default_column, fallback_column)
26
+ def normalize_config(config, default_column)
27
27
  return { column: nil, null: true } if config[:column].nil? && config.key?(:column)
28
28
 
29
29
  column = config[:column] || default_column
30
- column = fallback_column unless column_names.include?(column.to_s)
31
30
  column = nil unless column_names.include?(column.to_s)
32
31
 
33
32
  null = config.key?(:null) ? config[:null] : column_nullable?(column)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: in_time_scope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kyohah