effective_resources 2.26.2 → 2.26.3

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: 1a5f21cf765885ef02922b5b777b6b6da135f73c7e3aa8ef2b7707afeccdd473
4
- data.tar.gz: 5e675ad42c234a38429331f6c25da8c81700e89bc0a13561918b9a0727dde7fc
3
+ metadata.gz: 832cce1bc8eec0595dc7f02ca59d5a395a46422ddfd8de4dc0bffd95c56a25a8
4
+ data.tar.gz: d9b75daec18de0f827ad15c617688dd1ff8814c2e8395c8c5fcf788ae8cc27c7
5
5
  SHA512:
6
- metadata.gz: cc2a99f88bbf80daf7fd0aa9113ebff4187577e99c636b5883927295cf6e55346be9a89fe9699e1589f1b9532d6f6ea24f708b6890d5991dd55d7759a930b167
7
- data.tar.gz: c1446888c6427ac4d3f94db77807124826d269b0c3189cee9dd85c0deaa424cf7e0d84d145e776ca8a74c2f08bb804cce4ac2066e5a41f51d2ece5b1ec86bdf9
6
+ metadata.gz: 7b27bcd49c2f57a27697e0333842e6176a4ef7bcf2a0d055d55ff9e16be950d35baa330e81a8dffb3b8ae54300267ef517575ae3236ec33614c2864d433a729a
7
+ data.tar.gz: 11c948c3e725355cf2c78dab2bb9ea8789badece24135cbb332d4819e2683b908400219a42d6b1bc22254d7a5416ec2d2923f97f6565cb83d92182221cee82ae
@@ -127,13 +127,15 @@ module Effective
127
127
  else # Maybe from a string field
128
128
  associated = relation.none
129
129
 
130
+ value_ids_integer_array = (value_ids.kind_of?(Array) && value_ids.length > 0 && value_ids.all? { |value| (value.to_i rescue nil).to_s == value })
131
+
130
132
  relation.unscoped.distinct(foreign_type).pluck(foreign_type).each do |klass_name|
131
133
  next if klass_name.nil?
132
134
 
133
135
  resource = Effective::Resource.new(klass_name)
134
136
  next unless resource.klass.present?
135
137
 
136
- associated = associated.or(relation.where(foreign_id => value_ids, foreign_type => klass_name))
138
+ associated = associated.or(relation.where(foreign_id => (value_ids_integer_array ? value_ids : resource.search_any(value)), foreign_type => klass_name))
137
139
  end
138
140
 
139
141
  case operation
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.26.2'.freeze
2
+ VERSION = '2.26.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.26.2
4
+ version: 2.26.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect