api_resource 0.6.9 → 0.6.10
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.
- data/Gemfile.lock +1 -1
- data/lib/api_resource/attributes.rb +2 -2
- data/lib/api_resource/version.rb +1 -1
- metadata +1 -1
data/Gemfile.lock
CHANGED
@@ -191,7 +191,7 @@ module ApiResource
|
|
191
191
|
|
192
192
|
def write_attribute(name, val)
|
193
193
|
old_val = read_attribute(name)
|
194
|
-
new_val = self.typecast_attribute(name, val)
|
194
|
+
new_val = val.nil? ? nil : self.typecast_attribute(name, val)
|
195
195
|
|
196
196
|
unless old_val == new_val
|
197
197
|
self.send("#{name}_will_change!")
|
@@ -247,7 +247,7 @@ module ApiResource
|
|
247
247
|
val = self.default_value_for_field(field)
|
248
248
|
end
|
249
249
|
# now we typecast
|
250
|
-
val = self.typecast_attribute(field, val)
|
250
|
+
val = val.nil? ? nil : self.typecast_attribute(field, val)
|
251
251
|
return @attributes_cache[field.to_sym] = val
|
252
252
|
end
|
253
253
|
end
|
data/lib/api_resource/version.rb
CHANGED