-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
Support AR enums in resource models #2210
Conversation
6ed88ca
to
e1e3729
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the idea. Do we need to translate the enums?
42c8434
to
56de65a
Compare
65e755a
to
c59d5cc
Compare
@tvdeyen any chance we can get this PR in before the next release? I believe it's ready from my side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice feature. I agree with the translation key, but I think we should not raise for missing translations.
c59d5cc
to
6c52755
Compare
translate enum values using I18n ``` activerecord: attributes: modelname: enumname: translated name enumname_values: value1: translated value 1 value2: translated value 2 ```
6c52755
to
473edb6
Compare
This PR adds support for ActiveRecord enums, in the context of Alchemy resource models.
If a resource model has enum values defined they'll be rendered in a select box within the resource form.
Example view

If we agree on this proposal I can add a test as well. I think adding a spec shouldn't be a big deal.