-
Notifications
You must be signed in to change notification settings - Fork 47
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
Extend column_for_attribute to work with form helpers (simple_form, etc) #26
Comments
This seems useful. Can you create a PR with some tests? |
Will do, have to work through some things downstream in the process for updating attributes and making sure all is good there, but yes, Ill put it on my to-do list and see what I can come up with. |
Shouldn't use OpenStruct here, just create a regular Struct somewhere to avoid method cache busting every time an hstore class is used in a form build. |
+1 for no OpenStruct. In fact, it should respect the original return type of column_for_attribute as closely as possible. While Struct/OpenStruct might meet the needs of simple_form, it could be surprising to someone expecting a different object. |
@peck, are you still hacking on this? |
This c1c16fb is a start on this. |
Any interest in adding this to the gem itself? I find myself using using the following function in my models that I pass into simple_form builders to have the fields show up as the correct type, and not just default to text after receiving nil.
The text was updated successfully, but these errors were encountered: