Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes support for ActiveModel::Dirty
This has always been broken, but I was waiting to see how it was addressed in ActiveRecord::Enum before fixing to make sure I had something that was more future-proof. The fix does not work in Rails 3.2 or 4.0, so it is disabled in ActiveRecord <= 4.0 which seems like a good compromise. Previously when using dirty attribute methods, it was hard to predict whether you'd get the string value or the enum class instance. Now it will always return the enum class instance for any of the attribute change methods.
- Loading branch information
1 parent
0e7f44f
commit 9a0fe92
Showing
3 changed files
with
105 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters