active_record_inherit_assoc 2.5.1 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_record_inherit_assoc.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04cc101cd9ce7c8437cef83f27076be712396755
|
4
|
+
data.tar.gz: e06db9fd2f33e39d5917b14e111381a871b5906a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c1e7c46447c1e35c57f5efdfe15d3190fa531aefdd649903569f5611e2ce8424a51a3c5d9ca3fb30141ac46eac1ba9d62294c8b91cffb73930a16ab1136b188
|
7
|
+
data.tar.gz: a48e6923fe0a70e42c042543a317df6c66d2f14d79a4b326f6ba7088b4598fad6a587172b2d9e781c8b169ed16b5752e3c5e5afa9b53ec237b10473520024c0f
|
@@ -31,7 +31,12 @@ module ActiveRecordInheritAssocPrepend
|
|
31
31
|
|
32
32
|
def attribute_inheritance_hash
|
33
33
|
return nil unless reflection.options[:inherit]
|
34
|
-
Array(reflection.options[:inherit]).inject({})
|
34
|
+
Array(reflection.options[:inherit]).inject({}) do |hash, association|
|
35
|
+
assoc_value = owner.send(association)
|
36
|
+
hash[association] = assoc_value
|
37
|
+
hash["#{through_reflection.table_name}.#{association}"] = assoc_value if reflection.options.key?(:through)
|
38
|
+
hash
|
39
|
+
end
|
35
40
|
end
|
36
41
|
|
37
42
|
if ActiveRecord::VERSION::MAJOR >= 4
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_inherit_assoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Osheroff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|