glue_gun_dsl 0.1.32 → 0.1.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/glue_gun/model.rb +10 -1
- data/lib/glue_gun/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07661a23d79df686dc13a303e0f587ba917764be1c4997bcc8d4d8d4d16ed928
|
4
|
+
data.tar.gz: 6c3397575e04e4167a57cbd5077eecc1eb81045098046907d5f4c77d7880bdcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 225192af034e5a47ed4c243be208fdf6893cccfd69c9de8a61d33d753ebc90016d58a62740613820e3fd24583b5bcde893224f133096d9cedc81e88140b7b135
|
7
|
+
data.tar.gz: c9ef51b408533fa050865cb474037f79e524f4c2a405796252efc18d85bc46c98101d8cd21c5a4dfd896c25798a2e3a54e4be69bd984ece7d495e8f56e275f48
|
data/lib/glue_gun/model.rb
CHANGED
@@ -198,7 +198,7 @@ module GlueGun
|
|
198
198
|
|
199
199
|
def attrs_and_associations(attributes)
|
200
200
|
foreign_keys = foreign_key_map
|
201
|
-
attributes.inject({}) do |h, (k, v)|
|
201
|
+
base_attrs = attributes.inject({}) do |h, (k, v)|
|
202
202
|
h.tap do
|
203
203
|
if foreign_keys.include?(k)
|
204
204
|
assoc_name = foreign_keys[k]
|
@@ -208,6 +208,15 @@ module GlueGun
|
|
208
208
|
end
|
209
209
|
end
|
210
210
|
end
|
211
|
+
base_attrs.reverse_merge(associations)
|
212
|
+
end
|
213
|
+
|
214
|
+
def associations
|
215
|
+
self.class.reflect_on_all_associations.inject({}) do |h, assoc|
|
216
|
+
h.tap do
|
217
|
+
h[assoc.name] = send(assoc.name)
|
218
|
+
end
|
219
|
+
end
|
211
220
|
end
|
212
221
|
|
213
222
|
def foreign_key_map
|
data/lib/glue_gun/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glue_gun_dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Shollenberger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|