Fix #14: attribute setting on loading from DB#15
Fix #14: attribute setting on loading from DB#15zverok wants to merge 1 commit intoankane:masterfrom
Conversation
|
Hi @zverok, thanks for the PR! I think it'd be better to use |
|
To expand on this, I wouldn't want writes to start failing due to validation errors if |
It is an interesting case. What behavior do you see as reasonable in such cases? Because I intended to bring this case as an argument towards my solution :)
I believe
With Moreover, if the field is I believe (BTW, another difference from AR default's handling--but purely theoretical for me--is that |
|
Thanks for the response, but it sounds like we have different opinions on this. Happy to support read-only attributes without changing the existing behavior (just skipping the |
Fixes the problem with
attr_readonlysetting by avoiding any assignment on loading of persisted models.I am not 100% sure this is a proper solution, but no tests fail 🤷