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

Why override Enum? #21

Open
james2m opened this issue Apr 8, 2016 · 1 comment
Open

Why override Enum? #21

james2m opened this issue Apr 8, 2016 · 1 comment

Comments

@james2m
Copy link

james2m commented Apr 8, 2016

This looks really good, thank you. I have a couple of questions about the implementation decisions…

I was wondering why you chose to override Enum as opposed to having a separate stateful_enum?
And if you're open to going the composition route rather than extending AR::Base?

@jessevdp
Copy link

Although I agree with the statement above. I think it is currently fine right? Unless ActiveRecord starts accepting a block argument to their enum method in a future release..

def enum(name = nil, values = nil, **options, &block)
return super unless block

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

No branches or pull requests

2 participants