glue_gun_dsl 0.1.33 → 0.1.34

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: 07661a23d79df686dc13a303e0f587ba917764be1c4997bcc8d4d8d4d16ed928
4
- data.tar.gz: 6c3397575e04e4167a57cbd5077eecc1eb81045098046907d5f4c77d7880bdcb
3
+ metadata.gz: 6a4c98f11ec6347be2232400cf7656e43450d1739f64b09b8bf8ce6ecced23f3
4
+ data.tar.gz: aac3f9607163591d4776251c55a1b3063f8c1c4be02b9e464c6a9ad779c7f520
5
5
  SHA512:
6
- metadata.gz: 225192af034e5a47ed4c243be208fdf6893cccfd69c9de8a61d33d753ebc90016d58a62740613820e3fd24583b5bcde893224f133096d9cedc81e88140b7b135
7
- data.tar.gz: c9ef51b408533fa050865cb474037f79e524f4c2a405796252efc18d85bc46c98101d8cd21c5a4dfd896c25798a2e3a54e4be69bd984ece7d495e8f56e275f48
6
+ metadata.gz: 59f461cda576741e958de906fc80facfd24fdc724a8e083acb1489d0b0a9252a21f71e12e419d5c7fe0f47dff5ab9e7e1938b161d17cbcfe3c6ab60f2bedab68
7
+ data.tar.gz: 2f6f96eb8160879d73d9f8321d5e4ad79b56b8cf279aa06aaf77cb55ff9b5a520cdb829c8adf49856d0a42cb32551ade6234c2fc71d409ce388d99f302180b88
@@ -61,7 +61,7 @@ module GlueGun
61
61
  def assign_attributes(attributes)
62
62
  return if attributes.blank?
63
63
 
64
- attributes = attributes.deep_symbolize_keys
64
+ attributes = attributes.to_h.deep_symbolize_keys
65
65
  db_attributes = self.class.extract_db_attributes(attributes)
66
66
 
67
67
  # Assign database attributes
@@ -78,7 +78,7 @@ module GlueGun
78
78
  end
79
79
 
80
80
  def find_or_create_by!(attributes)
81
- attributes = attributes.deep_symbolize_keys
81
+ attributes = attributes.to_h.deep_symbolize_keys
82
82
  db_attributes = extract_db_attributes(attributes)
83
83
  attributes.except(*db_attributes.keys)
84
84
 
@@ -91,7 +91,7 @@ module GlueGun
91
91
  end
92
92
 
93
93
  def find_or_create_by(attributes)
94
- attributes = attributes.deep_symbolize_keys
94
+ attributes = attributes.to_h.deep_symbolize_keys
95
95
  db_attributes = extract_db_attributes(attributes)
96
96
  attributes.except(*db_attributes.keys)
97
97
 
@@ -107,8 +107,9 @@ module GlueGun
107
107
  # Extract attributes that correspond to database columns or associations
108
108
  column_names = self.column_names.map(&:to_sym)
109
109
  association_names = reflect_on_all_associations.map(&:name)
110
+ nested_attributes = association_names.map { |name| "#{name}_attributes".to_sym }
110
111
 
111
- attributes.slice(*(column_names + association_names))
112
+ attributes.slice(*(column_names + association_names + nested_attributes))
112
113
  end
113
114
  end
114
115
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GlueGun
4
- VERSION = "0.1.33"
4
+ VERSION = "0.1.34"
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.33
4
+ version: 0.1.34
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-07 00:00:00.000000000 Z
11
+ date: 2024-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel