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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3cf32bd978003b64f6829fe0b70c3d11bbb8ef11d3b81726dda32e0c38373c91
4
- data.tar.gz: 5425fd7f5759384543ff68db8f5385a1c55bb0a9274307dae86520bbdeb029bf
3
+ metadata.gz: 07661a23d79df686dc13a303e0f587ba917764be1c4997bcc8d4d8d4d16ed928
4
+ data.tar.gz: 6c3397575e04e4167a57cbd5077eecc1eb81045098046907d5f4c77d7880bdcb
5
5
  SHA512:
6
- metadata.gz: 92a949dd966551b2c5ed1364e2535a92c826391a592233b3a646a4957895b848f3f9d02225a50cb0e93b72ef211187f384821f2afc901918153f1004176999fd
7
- data.tar.gz: c4f8446ef0d897814eca53d3e65e1143e6ea9cf6e0c9e057f25559abb45210ed36b3940379fd1547d96a503d6a39cf4b3b4c690c9443a3dd8d071fad14df66ac
6
+ metadata.gz: 225192af034e5a47ed4c243be208fdf6893cccfd69c9de8a61d33d753ebc90016d58a62740613820e3fd24583b5bcde893224f133096d9cedc81e88140b7b135
7
+ data.tar.gz: c9ef51b408533fa050865cb474037f79e524f4c2a405796252efc18d85bc46c98101d8cd21c5a4dfd896c25798a2e3a54e4be69bd984ece7d495e8f56e275f48
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GlueGun
4
- VERSION = "0.1.32"
4
+ VERSION = "0.1.33"
5
5
  end
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.32
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-05 00:00:00.000000000 Z
11
+ date: 2024-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel