lib/conglomerate/serializer.rb in conglomerate-0.11.0 vs lib/conglomerate/serializer.rb in conglomerate-0.11.1
- old
+ new
@@ -191,20 +191,16 @@
link = {"rel" => rel.to_s}
apply_href(link, :proc => proc, :object => object)
end
def sanitize_value(object, name:, type: :value, default_value: nil)
- if blank?(object) || blank?(object.send(name))
+ if object.nil? || object.send(name).nil?
if type == :array
[]
elsif type == :object
{}
else
- if present?(object) && object.send(name) == false
- false
- else
- default_value
- end
+ default_value
end
else
object.send(name)
end
end