lib/representable/definition.rb in representable-1.8.2 vs lib/representable/definition.rb in representable-1.8.3
- old
+ new
@@ -65,12 +65,14 @@
def representer_module
self[:extend]
end
- def skipable_nil_value?(value)
+ def skipable_empty_value?(value)
+ return true if array? and self[:render_empty] == false and value and value.size == 0 # TODO: change in 2.0, don't render emtpy.
value.nil? and not self[:render_nil]
end
+ alias_method :skipable_nil_value?, :skipable_empty_value? # TODO: remove in 1.9 .
def create_binding(*args)
self[:binding].call(self, *args)
end