state_of_the_nation 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/.ruby-version +1 -1
- data/lib/state_of_the_nation/version.rb +1 -1
- data/lib/state_of_the_nation.rb +4 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36525e79ab3fded0f8985975e73eaac75b0d535b530a1261bb8208d2e984b330
|
4
|
+
data.tar.gz: 2da7c70d311533899e611d3118f048763c753f4560880483b7bb4e27552e172f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48703e6f70341a407ffd5d2804e09681b8ac841c48776aba500a6e0f32348300c4fdfa15d985be3a38b2dc22e41c8687d92dab0f0d94f7b244a5f23d80be335e
|
7
|
+
data.tar.gz: e3f1d4895d066f56ad5aa2d23aff060c71787e005c7c7609e8182af7b5cd3e2ba2840c986381fe68a5e9982c0ed88cf044f4b0522ef19b82974751ef48764a79
|
data/.circleci/config.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.5
|
data/lib/state_of_the_nation.rb
CHANGED
@@ -85,8 +85,10 @@ module StateOfTheNation
|
|
85
85
|
private
|
86
86
|
|
87
87
|
def add_child_methods(plural:, single:, with_identity_cache:)
|
88
|
-
|
89
|
-
name = self.name.demodulize.underscore.to_sym
|
88
|
+
reflection = self.reflect_on_association(plural)
|
89
|
+
name = reflection.inverse_of&.name || self.name.demodulize.underscore.to_sym
|
90
|
+
|
91
|
+
child_class = reflection.klass
|
90
92
|
child_class.instance_variable_set(:@parent_association, name)
|
91
93
|
child_class.instance_variable_set(:@prevent_multiple_active, single)
|
92
94
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: state_of_the_nation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick O'Doherty
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-05-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -223,8 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
223
|
- !ruby/object:Gem::Version
|
224
224
|
version: '0'
|
225
225
|
requirements: []
|
226
|
-
|
227
|
-
rubygems_version: 2.7.6.2
|
226
|
+
rubygems_version: 3.1.6
|
228
227
|
signing_key:
|
229
228
|
specification_version: 4
|
230
229
|
summary: An easy way to model state that changes over time with ActiveRecord
|