auto_define_scope 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b411e8fbe13d8df01d64c0eed8ac40eab0e88d8bd079a6fb95478a169ee260a
4
- data.tar.gz: 9c24148854615f854cd18f5f3fb6f485e2b729341ec25e7bd7a4c08768cee1e3
3
+ metadata.gz: aeeee9436fd2fd06c0755f63ed0425d9c3259a18e241647475b75c1eef5b32c5
4
+ data.tar.gz: 2d78c952dd6e2ef6e1bc3ee87212321fb8a6cc0c7250fe842904a22ba93364f9
5
5
  SHA512:
6
- metadata.gz: 18d5a5df81ad4188fb132a47abd51e5940632742676b46e071d890a259231430e7966e5fbe2a2968c9a9a8f36da2be5c6d1dba06886a6094cbe47dd4dfc02f25
7
- data.tar.gz: 2de98abcb378d8245acf94c1495897402454c4f36e56de7d0e2d74c7d758c739139bfbf7f90d2971c1765f220a6766b3a6a011f911e8dca626bbfbc46440374b
6
+ metadata.gz: 50f966ec588e3d48fbad647a3be736e842df9d89e54d87428ec05d025ad7efe63b6f98703f48f5bd063c7f91a54780c46d18b62a622452c6ed98e31b464f16f4
7
+ data.tar.gz: 6dc5b55b6f1382f2dbaa71f01faccc3be0edad45f02572948e5e8f803cb2dddf0e226e71e3305cb48e2ada97d8d164dc7658817dc466ec5b60cf2ca0500ca6f3
@@ -46,7 +46,7 @@ module AutoDefineScope
46
46
  next
47
47
  end
48
48
  column_type = columns_hash[c.to_s]&.type
49
- raise "scopes defined error, not found column('#{c}') for table #{klass.table_name}" if column.nil?
49
+ raise "scopes defined error, not found column('#{c}') for table #{klass.table_name}" if column_type.nil?
50
50
  joins_params = joins_params_array.reverse.inject() { |a, n| { n => a } }
51
51
  table_name = klass.table_name
52
52
  @auto_define_scopes ||= []
@@ -58,6 +58,8 @@ module AutoDefineScope
58
58
  value.to_i
59
59
  when :string
60
60
  value.to_s
61
+ else
62
+ value
61
63
  end
62
64
  value = type == :with ? value : "%#{value}%"
63
65
  joins(joins_params).where("#{table_name}.#{c} #{OPERATE_SQL[type]}", value)
@@ -1,3 +1,3 @@
1
1
  module AutoDefineScope
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto_define_scope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - tinyfeng.hou