glue_gun_dsl 0.1.33 → 0.1.34
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 +5 -4
- 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: 6a4c98f11ec6347be2232400cf7656e43450d1739f64b09b8bf8ce6ecced23f3
|
4
|
+
data.tar.gz: aac3f9607163591d4776251c55a1b3063f8c1c4be02b9e464c6a9ad779c7f520
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59f461cda576741e958de906fc80facfd24fdc724a8e083acb1489d0b0a9252a21f71e12e419d5c7fe0f47dff5ab9e7e1938b161d17cbcfe3c6ab60f2bedab68
|
7
|
+
data.tar.gz: 2f6f96eb8160879d73d9f8321d5e4ad79b56b8cf279aa06aaf77cb55ff9b5a520cdb829c8adf49856d0a42cb32551ade6234c2fc71d409ce388d99f302180b88
|
data/lib/glue_gun/model.rb
CHANGED
@@ -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
|
|
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.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-
|
11
|
+
date: 2024-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|