effective_resources 2.26.1 → 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: 5c1d1d08ea965b86966add386e7676e3f4961289ea9bc7c2a1f05b81d5dfd6e6
4
- data.tar.gz: 28e1fd1ec285d91b62c7b0f082de1b3a8183647b67a101240b6d7e6aa4c2a79a
3
+ metadata.gz: 832cce1bc8eec0595dc7f02ca59d5a395a46422ddfd8de4dc0bffd95c56a25a8
4
+ data.tar.gz: d9b75daec18de0f827ad15c617688dd1ff8814c2e8395c8c5fcf788ae8cc27c7
5
5
  SHA512:
6
- metadata.gz: 1f652b7ef3003bb3cf6a439f2bedc84bfd49f7391f3eb4040d3c49d7739142803d393fd08d0bf3620274639ff2b0ff7939c0e682d91e99df8afd79449ce11987
7
- data.tar.gz: 44f0c457a5cc6692489b2f6809aed69379d28984d662fc0401b9894c940a28edc03d051e196bdfd44702ff9f460c9270c3e5f50c99358c6d056492c1ac4af677
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 => resource.search_any(value), 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.1'.freeze
2
+ VERSION = '2.26.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.26.1
4
+ version: 2.26.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-16 00:00:00.000000000 Z
11
+ date: 2024-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails