simple_enum icon indicating copy to clipboard operation
simple_enum copied to clipboard

simple_enum should add the attribute name to the attribute_names class method

Open lexi-lambda opened this issue 10 years ago • 1 comments

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.

lexi-lambda avatar Aug 03 '15 18:08 lexi-lambda

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

lwe avatar Aug 04 '15 10:08 lwe