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 +4 -4
- data/app/models/effective/resources/relation.rb +3 -1
- data/lib/effective_resources/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 832cce1bc8eec0595dc7f02ca59d5a395a46422ddfd8de4dc0bffd95c56a25a8
|
4
|
+
data.tar.gz: d9b75daec18de0f827ad15c617688dd1ff8814c2e8395c8c5fcf788ae8cc27c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
11
|
+
date: 2024-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|