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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5744502d4b1e1941a08f829565227940755e2242
4
- data.tar.gz: 5f27dc1364e9859a0cae9dd40d03cafa25f57534
3
+ metadata.gz: 04cc101cd9ce7c8437cef83f27076be712396755
4
+ data.tar.gz: e06db9fd2f33e39d5917b14e111381a871b5906a
5
5
  SHA512:
6
- metadata.gz: ac5a23f39ff9ed338c004966f7e0077c27c71309932636379af39a49598abab216718481f0f91d2b21550cc9acc5b202a48599dadea739aa3e31865111e70924
7
- data.tar.gz: e9eaa77c7e46fec4faf8401828144b1d84b12d6250cef9205d1ad817fdd330d3e7c60a59c7896b0ad278cb46c6693d13bc29c2269ddfd3e7feebbd65421478da
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({}) { |hash, association| hash[association] = owner.send(association) ; hash }
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.5.1
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: 2017-12-29 00:00:00.000000000 Z
11
+ date: 2018-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord