glue_gun_dsl 0.1.28 → 0.1.29
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 -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: 1c7ef75df045c142a9b1175b91ad7f7745179ea3dacfa5c30c2b2409e1d4fe78
|
4
|
+
data.tar.gz: 3e55b0b662c7ccf655e784cc9672a5e6f7a792268bd0140d28e66b8b4439b627
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f97de5312eaaae95f2c57bd8691a4751f55902ffdd7f8140d0f11a6548c2004afc47f31612f1e7ad14b42e2d530bdbf588349a9e8c4c0645a8dc760da3b383c4
|
7
|
+
data.tar.gz: 11916bd9c893ce87058a1fbf1e4f2b4b9fbcd16b8867493e35c932622e8ebcbe43ed8cee3291219aa24a274cb60a79f6d1f9ae15c67c712e1bf3f3398805f6a6
|
data/lib/glue_gun/model.rb
CHANGED
@@ -139,6 +139,10 @@ module GlueGun
|
|
139
139
|
|
140
140
|
private
|
141
141
|
|
142
|
+
def awesome_print(message)
|
143
|
+
ap message
|
144
|
+
end
|
145
|
+
|
142
146
|
def build_service_object(attributes)
|
143
147
|
self.class.send(:attr_reader, service_attribute_name)
|
144
148
|
service_class = resolve_service_class(attributes)
|
@@ -148,9 +152,9 @@ module GlueGun
|
|
148
152
|
begin
|
149
153
|
service_instance = service_class.new(service_attributes)
|
150
154
|
rescue StandardError => e
|
151
|
-
|
152
|
-
|
153
|
-
|
155
|
+
awesome_print %(Error building service object #{service_class}:)
|
156
|
+
awesome_print e.message
|
157
|
+
awesome_print e.backtrace
|
154
158
|
raise e
|
155
159
|
end
|
156
160
|
instance_variable_set("@#{service_attribute_name}", service_instance)
|
@@ -159,8 +163,10 @@ module GlueGun
|
|
159
163
|
def resolve_service_type(attributes, initializing = false)
|
160
164
|
attrs = if initializing || !persisted? || attributes.key?(self.class.option_key)
|
161
165
|
attributes
|
162
|
-
|
166
|
+
elsif respond_to?(self.class.option_key)
|
163
167
|
{ self.class.option_key => send(self.class.option_key) }
|
168
|
+
else
|
169
|
+
{ self.class.option_key => self.class.service_registry.default_key }
|
164
170
|
end
|
165
171
|
attrs[self.class.option_key] || self.class.service_registry.default_key
|
166
172
|
end
|
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.29
|
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-10-
|
11
|
+
date: 2024-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|