lib/databasedotcom/client.rb in databasedotcom-1.2.5 vs lib/databasedotcom/client.rb in databasedotcom-1.2.6
- old
+ new
@@ -497,9 +497,11 @@
case clazz.field_type(key)
when "multipicklist"
coerced_attrs[key] = (attrs[key] || []).join(';')
when "datetime"
coerced_attrs[key] = attrs[key] ? attrs[key].strftime(RUBY_VERSION.match(/^1.8/) ? "%Y-%m-%dT%H:%M:%S.000%z" : "%Y-%m-%dT%H:%M:%S.%L%z") : nil
+ when "date"
+ coerced_attrs[key] = attrs[key] ? attrs[key].strftime("%Y-%m-%d") : nil
else
coerced_attrs[key] = attrs[key]
end
end
coerced_attrs.to_json