active_record_inherit_assoc 2.10.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3114b730174fd26ee0f56c6e133fb5d93706d80770fa265d3c040eb1c29638ec
4
- data.tar.gz: b3e5f39e1255c5f588b7b250920eadea41d50fac9285b19f387958d8367eb4b9
3
+ metadata.gz: 9524fb500abe5d5f81a49ca6b4c8e45fdcaaca94b18624fb9c1c31ac658f46df
4
+ data.tar.gz: 5002be646071088dc91dd12c2e6a7ddcb4ee9bc1e9e57789c94acfe1f9ea029c
5
5
  SHA512:
6
- metadata.gz: 3fae511b4f18e0908e2c155a841896f76b2bd10d30a699c4d104233ad92d1666af3e51d93429e6ec430ec02a1bdc1d90454373b391893f7734536186e364ff39
7
- data.tar.gz: 1d270c6bc45fdbbf784ac4c7e465a303a06f2f4248f960f68b788fe85516c1848ddc7a4cdbe92ee5b85378f3b2434b8a5270832f9226df397e06314a6a7aeab7
6
+ metadata.gz: 155b4f0726f474e1bff0704cd5cefc009407e796e31df31cd456b33105ffb125534071c0056c8d2c9ae233ccba9db4e158b5ea585796958509e976cda66bbb30
7
+ data.tar.gz: 6d85eeddbeebb22610bba310f304f987ec20116e33f0ea390dcb8a2172ecb1d4ed32d84ac12a6f4219ad0e0ba9c37876c26ec45360c02e05bc81eaadac6c573f
@@ -1,21 +1,15 @@
1
1
  require 'active_record'
2
2
 
3
- case ActiveRecord::VERSION::MAJOR
4
- when 4
5
- ActiveRecord::Associations::Builder::Association.valid_options << :inherit
6
- ActiveRecord::Associations::Builder::Association.valid_options << :inherit_allowed_list
7
- when 5
8
- # We can't add options into `valid_options` anymore.
9
- # Here are the possible solutions:
10
- # * monkey patch Assocition::VALID_OPTIONS
11
- # * prepend the `valid_options` method
12
- # * create an Extension class and add it via ActiveRecord::Associations::Builder::Association.extensions
13
- #
14
- # I went with the first one out of simplicity.
15
- ActiveRecord::Associations::Builder::Association::VALID_OPTIONS << :inherit
16
- ActiveRecord::Associations::Builder::Association::VALID_OPTIONS << :inherit_allowed_list
3
+ module ActiveRecordInheritBuildAssocPrepend
4
+ INHERIT_OPTIONS = %i[inherit inherit_allowed_list].freeze
5
+
6
+ def valid_options(options)
7
+ super + INHERIT_OPTIONS
8
+ end
17
9
  end
18
10
 
11
+ ActiveRecord::Associations::Builder::Association.singleton_class.prepend(ActiveRecordInheritBuildAssocPrepend)
12
+
19
13
  module ActiveRecordInheritAssocPrepend
20
14
  def target_scope
21
15
  if inherited_attributes = attribute_inheritance_hash
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.10.0
4
+ version: 2.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Osheroff
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-21 00:00:00.000000000 Z
11
+ date: 2022-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.2.0
19
+ version: 5.0.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5.3'
22
+ version: '6.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 4.2.0
29
+ version: 5.0.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.3'
32
+ version: '6.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: minitest
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -100,20 +100,6 @@ dependencies:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
- - !ruby/object:Gem::Dependency
104
- name: wwtd
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- version: '0'
117
103
  - !ruby/object:Gem::Dependency
118
104
  name: sqlite3
119
105
  requirement: !ruby/object:Gem::Requirement
@@ -142,7 +128,7 @@ dependencies:
142
128
  - - ">="
143
129
  - !ruby/object:Gem::Version
144
130
  version: '0'
145
- description:
131
+ description:
146
132
  email:
147
133
  - ben@gimbo.net
148
134
  executables: []
@@ -154,7 +140,7 @@ homepage: https://github.com/zendesk/active_record_inherit_assoc
154
140
  licenses:
155
141
  - Apache License Version 2.0
156
142
  metadata: {}
157
- post_install_message:
143
+ post_install_message:
158
144
  rdoc_options: []
159
145
  require_paths:
160
146
  - lib
@@ -162,15 +148,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
162
148
  requirements:
163
149
  - - ">="
164
150
  - !ruby/object:Gem::Version
165
- version: '2.4'
151
+ version: '2.7'
166
152
  required_rubygems_version: !ruby/object:Gem::Requirement
167
153
  requirements:
168
154
  - - ">="
169
155
  - !ruby/object:Gem::Version
170
156
  version: '0'
171
157
  requirements: []
172
- rubygems_version: 3.0.3
173
- signing_key:
158
+ rubygems_version: 3.1.6
159
+ signing_key:
174
160
  specification_version: 4
175
161
  summary: Attribute inheritance for AR associations
176
162
  test_files: []