-
Notifications
You must be signed in to change notification settings - Fork 45
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
This is incompatible with rails 4.2 #25
Comments
It looks like this issue has been fixed on master but the update has not been released to rubygems.org yet. You can just point to the source in your Gemfile and install it to get the fix. |
I am having trouble on rails 4.2 still. A fix I found would be to move the alias lines below the methods they are aliasing in enum_adapter.rb. |
@Lambenttelos This doesn't work. By moving the aliasing after the override definitions, you're just aliasing the newly declared methods. Your columns will have a type of The break in Rails 4.2 is because of this refactoring and other subsequent updates by @sgrif - instead of defining the type using I've made all of these changes in https://github.com/jewlr/enum_column for those who are interested. The code should also be backwards compatible down to Rails 3. |
@schuylr Thanks for the update! I just took a novice guess at it and yeah that one change I suggested would have just changed where I would have run into errors then. With the project I was updating at the time we just decided to rip out the gem and use the built in enum functionality that is in active record now which was easy for us as our use case was simple. We have some other projects that are not so simple and this fix should save some headaches. |
enum_column3-0.1.4/lib/enum/enum_adapter.rb:30:in
block in <top (required)>': undefined method
type_cast' for class `ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::Column' (NameError)The text was updated successfully, but these errors were encountered: