I'm getting a NoMethodError for enumerate in my ActiveRecord models. I followed the site instructions exactly, can interact with Enum classes in Console.
Running Rails 3.0.9 and MRI 1.9.2.
Try uncommenting the extend_clases in the config. It used to detect AR automatically and extend it.
I had this problem too but uncommenting the suggested line solved my problem.
Pushed a new release that should fix this in Rails with a Railtie.
Using rails 3.2.6 and active_enum 0.9.8 (latest on gem install), I also had to uncomment the extend_classes parm to get enumerable to work. IAE, this is a wonderful (forking brilliant, actually) gem -- especially with the i18n support.
Damn, I stuffed that up. I've released a new version.
Thanks. 0.9.9 works without me having to uncomment the config.extend_classes setting
Hi, I ran into this problem using Rails 4. I saw that active_enum should be compatible, but there seems to be a difference in version 0.9.12 on Rubygems.org and that same version here on Github. If I point to the latter directly it all seems to work. If I specify gem 'active_enum', '~> 0.9.12' to fetch from Rubygems I get this error:
Bundler could not find compatible versions for gem "activesupport":
active_enum (~> 0.9.12) ruby depends on
activesupport (~> 3.0) ruby
rails (>= 4) ruby depends on
When I point to master I see this in gemfile.lock:
activesupport (>= 3.0)
Which would indeed allow for higher versions of activesupport.
I'm still relatively new to Rails so it could very well be that I'm overlooking something, in that case just remove this comment. Anyway, glad to have active_enum working again, love it.
To anyone coming here from Google, in case the above comments don't make it clear: you can work around this issue by changing gem 'active_enum' in your Gemfile to gem 'active_enum', github: 'adzap/active_enum'.
gem 'active_enum', github: 'adzap/active_enum'