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

simple_enum should add the attribute name to the attribute_names class method #108

Open
lexi-lambda opened this issue Aug 3, 2015 · 1 comment

Comments

@lexi-lambda
Copy link

ActiveRecord models include the attribute_names method, which, as the name suggests, lists all the attributes the model exposes. As it turns out, ParamsWrapper uses the result of this method to determine which attributes to wrap. Since it just uses column names by default, the column itself will be wrapped (e.g. gender_cd) but not the enum attribute (e.g. gender).

It would be nice if simple_enum extended this list to include the enum attribute name so that ParamsWrapper automagically works with models that include enums.

@lwe
Copy link
Owner

lwe commented Aug 4, 2015

Thanks for the input, would there be any other unintended side-effects of exposing the _cd methods in attribute_names?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants