Open
Description
default_value_for/lib/default_value_for.rb
Lines 159 to 170 in c52d291
The above code has a few more edge cases that are missed, specifically with the second two cases in the outer conditional where the attribute is not backed by a database column. The next two cases must account for the same issue (attribute can either be a boolean where false
is not 'blank', it's a set value, but false.nil? == true
, or a collection that is empty via blank?
).
This whole thing should be cleaned up, with perhaps a few comments explaining each case.
See d155ba7#commitcomment-30274475
cc/ @romaind