-
Notifications
You must be signed in to change notification settings - Fork 995
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
Fixes #38197 - Allow unsetting settings with nil defaults #10435
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code makes sense to me and I'd trust the tests.
I wonder if we should start avoiding nil as default and rely on empty strings, but don't have a good view on the impact so this is probably a good start. Did you consider that option too?
|
||
assert s.save | ||
assert_nil s.value | ||
assert_nil s.read_attribute(:value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my understanding, why this in addition to s.value
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit of a stretch, but in theory it could happen that s.value
would be nil
, but the db field would be a nil serialized to yaml (---\n
) instead of a proper null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 but do you mind fixing the typo in the commit message?
788ea5e
to
31b0ce1
Compare
Done, test failures seem unrelated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @adamruzicka and @ekohl !
No description provided.