effective_resources 0.3.7 → 0.3.8
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d1402ecc05965bee97bc9bc54cab706bac0fed5
|
4
|
+
data.tar.gz: 3f6b2afd4c260dc4ecd7460e0ab68043b778509c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f8fcd372c81a61cf1592533a4914bf1bfff2a7a0ccfd83eb385a798fb4e81d7f157e876b0e61c99897bf510ce64b68cc69920d68061abddfddd79f25e84275c
|
7
|
+
data.tar.gz: 9f20ffeb34e900ba6e48d593613c8aeb4be46a8463cc4cd31c052b2b8aa2b9844dca83bb6fb5a1c4124dbd8708c72f734a8a8c715ae530d5db6f0f05a144fdf2
|
@@ -184,7 +184,7 @@ module Effective
|
|
184
184
|
keys = klass.joins(association.name)
|
185
185
|
.where(association.name => { association.source_reflection.klass.primary_key => values })
|
186
186
|
.pluck(klass.primary_key)
|
187
|
-
elsif association.
|
187
|
+
elsif association.options[:through].present?
|
188
188
|
key = sql_column(klass.primary_key)
|
189
189
|
|
190
190
|
if association.source_reflection.options[:polymorphic]
|
@@ -201,7 +201,12 @@ module Effective
|
|
201
201
|
scope = scope.where(association.source_reflection.foreign_type => reflected_klass.name)
|
202
202
|
end
|
203
203
|
|
204
|
-
|
204
|
+
if association.through_reflection.macro == :belongs_to
|
205
|
+
key = association.through_reflection.foreign_key
|
206
|
+
keys = scope.pluck(association.through_reflection.klass.primary_key)
|
207
|
+
else
|
208
|
+
keys = scope.pluck(association.through_reflection.foreign_key)
|
209
|
+
end
|
205
210
|
elsif association.macro == :has_many
|
206
211
|
key = sql_column(klass.primary_key)
|
207
212
|
keys = relation.pluck(association.foreign_key)
|
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: 0.3.
|
4
|
+
version: 0.3.8
|
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: 2017-
|
11
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|