- Fixes saving and reloading ActiveRecord models that assign enum using class
Allow enum property to be assigned using enum class. Previously it could only be assigned with an instance, string or symbol.
@alarm.priority = Priority::Medium @alarm.priority.medium? # => true
- Fixes a regression with Formtastic support. ClassyEnumm::Base.build now returns a null object that decends from the base_class when the argument is blank (nil, empty string, etc). This allows the ActiveRecord model's enum attribute to respond to enum methods even if it is blank.
- ClassyEnum::Base now extends Enumerable to provide enum collection methods. All objects in the collection are instances of the enum members. .find is overridden to provide custom find functionality.
- ClassyEnum::Base.find has been reintroduced, with aliases of .detect and .
- Introducing I18n support and providing a ClassyEnum::Base#text method that will automatically translate text values.
- Translation support was added to ClassyEnum::Base.select_options.
Equality can now be determined using strings and symbols. The following will return true:
Priority::Low.new == :low # => true Priority::Low.new == 'low' # => true
- Removing ClassyEnum::Base.enum_classes in favor of using enum inheritance to setup classes
- Removing ClassyEnum::Base.valid_options
- Removing ClassyEnum::Base.find
- Removing ClassyEnum::Base#name
- Removing :suffix option from classy_enum_attr
- Enforce use of namespacing for subclasses (Parent::Child < Parent)
- Use require instead of autoload
- Lots of code refactoring
- Deprecating ClassyEnum::Base#name (use to_s.titleize instead).
nameis too ambiguous and might get confused with Ruby's Class.name method.
- Deprecating :suffix option from classy_enum_attr (this was a temporary hack)
- Deprecating class names like ParentChild in favor of namespaced names like Parent::Child
- Deprecating ClassyEnum::Base.enum_classes() (this is no longer needed)
- Deprecating ClassyEnum::Base.valid_options()(use all.join(', ') instead)
- Deprecating ClassEnum::Base.find() (use build() instead)
- Fixes issue with validates_uniqueness_of when using an enum field as the scope.
2.0.1 & 2.0.2
- Resolving gem release conflicts, no changes
- Enum class definitions are no longer defined implicitly and must be explicitly subclassed from children of ClassyEnum::Base
- Formtastic support is not longer built-in. See https://github.com/beerlington/classy_enum/wiki/Formtastic-Support
- validates_uniqueness_of with an enum scope no longer works in Rails 3.0.x (no changes for Rails 3.1 or 3.2)
- Added support for Ruby 1.9.3
- Stop hijacking enum initialize method
- Fixed JSON recursion issue
- Added support for Rails 3.1.x
- Added support for owner enum reference
- Code refactor
- Removed support for Rails 2.x.x
- Fixed support for validates_uniqueness_of with an enum scope
- Fixed Rails dependency requirement
- Further decoupled Formtastic support
- Added blank/nil option support to Formtastic
- Fixed documentation typos
- Updated development dependencies
- Changed API for column and enum name differences
- Added Comparable support
- Fixed an issue with invalid objects set to empty string
- Added allow blank support to Formtastic
- Improved error messages
- Added "boolean" methods (i.e.
- Improved documentation
- Updated generators to make inheritance more explicit
- Removed ActiveRecord dependency
- Fixed validates_presence_of support
- Improved Formtastic support
- Changed enums to use inheritance instead of mixins
- Fixed issue with generators
- Fixed documentation typos
- Fixed documentation
- Cleaned up hacky support for Rails 3.0.x
- Fixed Formtastic load support
- Fixed validation issue in Rails 3.0.x
- Added enum generator for Rails 3.0.x
- Added support for Ruby 1.9.2
- Fixed support for apps that are not using Formtastic
- Fixed Formtastic helper support w/ Rails 3.0.x
- Added custom Formtastic input type
- Internal changes to how methods are defined
- Added enum generator for Rails 2.3.x
- Internal changes to how ActiveRecord is extended
- More test coverage
- Fixed initialized constant warning
- Initial Release