Skip to content
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

_before_type_cast should return the default value if no custom value exists #15

Open
stex opened this issue Jan 17, 2019 · 0 comments
Open
Labels

Comments

@stex
Copy link
Owner

stex commented Jan 17, 2019

Currently, calling _before_type_cast on a setting_accessor will return nil if no custom value was set yet.

Instead, it should return the default value to mimic AR's behaviour.

The main reason to fix this is that Rails' text_field form helper looks for the attribute's ´value_before_type_cast` instead of just calling it - leading to an empty input field.

@stex stex added the bug label Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant