active_record_inherit_assoc 2.10.0 → 2.12.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 +8 -14
- metadata +12 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7464b4f61c782b150c6100fcf822b5cbc7c3f0efe1c4ba19073caeb97f61c47
|
4
|
+
data.tar.gz: a03bc5d15df64295725a023d897d58ed7feec22f7b64aff6b179d599d341bc3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 560b8bb3dbe7e42cb3f7ef7ebdf7a1239d2ecaca856d80f86e50fa76395ee18d86b00701707ddb5aa55433bebc0a3e3b857252f821707119182b2100a1e7c12d
|
7
|
+
data.tar.gz: 9ad0c5cc7eec65fe81591b68c92d10b496632f9e8de50ab76c5dfcd20a3b02e6d2219c05429225ab16979f07a392c4421e6758dddae0ab2205b4dba9921f8b39
|
@@ -1,21 +1,15 @@
|
|
1
1
|
require 'active_record'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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.
|
4
|
+
version: 2.12.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:
|
11
|
+
date: 2022-09-21 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:
|
19
|
+
version: 5.0.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
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:
|
29
|
+
version: 5.0.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
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.
|
151
|
+
version: '2.6'
|
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.
|
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: []
|