stateful_enum
stateful_enum copied to clipboard
Why override Enum?
trafficstars
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?
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..
https://github.com/amatsuda/stateful_enum/blob/fa8f17cc39050e428ceb4105f91062669a3679ba/lib/stateful_enum/active_record_extension.rb#L13-L14