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

Suggestion: Add prefix to enum types #84

Closed
acetinick opened this issue Feb 1, 2021 · 3 comments
Closed

Suggestion: Add prefix to enum types #84

acetinick opened this issue Feb 1, 2021 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@acetinick
Copy link

acetinick commented Feb 1, 2021

Hi,

Great library, have migrated already out settings stores to this library and works great.

One thing that it would be great is for enum types to support prefix settings.

Currently to avoid conflicts for many enum settings it would be good to have this similar feature from enum rails core

eg.

enum :authentication_method, %i[email phone], default: :email
enum :notification_method, %i[email phone], default: :email

currently we get arround this by doing this,

enum :authentication_method, %i[authentication_method_email authentication_method_phone], default: :authentication_method_email
enum :notification_method, %i[notification_method_email notification_method_phone], default: :notification_method_email

however, would be cleaner to have

enum :authentication_method, %i[email phone], default: :email, _prefix: true
enum :notification_method, %i[email phone], default: :email, _prefix: true

@DmitryTsepelev
Copy link
Owner

Hi @acetinick, nice to hear that the gem was useful to you 🙂 This feature definitely makes sense, do you want to take a lead on implementing it?

@DmitryTsepelev DmitryTsepelev added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Feb 1, 2021
@acetinick
Copy link
Author

Yep sure, would be something I can help out with over the coming weeks.

@DmitryTsepelev
Copy link
Owner

Implemented in #102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants