-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in blank attribute detection w/o column backing #77
Labels
Comments
@chrisarcand thanks a lot for taking what I mentionned into account. |
@chrisarcand currently working on that |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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, butfalse.nil? == true
, or a collection that is empty viablank?
).This whole thing should be cleaned up, with perhaps a few comments explaining each case.
See d155ba7#commitcomment-30274475
cc/ @romaind
The text was updated successfully, but these errors were encountered: