CHANGELOG.md in classy_enum-3.1.3 vs CHANGELOG.md in classy_enum-3.2.0
- old
+ new
@@ -1,19 +1,42 @@
# ClassyEnum Changelog
+## 3.2.0
+
+* Default values can now be specified within an ActiveRecord model
+
+```ruby
+class Alarm < ActiveRecord::Base
+ classy_enum_attr :priority, :default => 'medium'
+end
+
+class Alarm < ActiveRecord::Base
+ classy_enum_attr :priority, :default => lambda {|enum| enum.last }
+end
+```
+
+* Adding ClassyEnum::Base#last. It's not part of the enumerable module
+ but it makes sense in this case.
+
+```ruby
+Priority.last # => Priority::High
+```
+
## 3.1.3
* Fixes saving and reloading ActiveRecord models that assign enum using
class
## 3.1.2
* 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
+```ruby
+@alarm.priority = Priority::Medium
+@alarm.priority.medium? # => true
+```
## 3.1.1
* Fixes a regression with Formtastic support. ClassyEnumm::Base.build now
returns a null object that decends from the base_class when the argument is
@@ -31,12 +54,14 @@
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
+```ruby
+Priority::Low.new == :low # => true
+Priority::Low.new == 'low' # => true
+```
## 3.0.0
* Removing ClassyEnum::Base.enum_classes in favor of using enum
inheritance to setup classes
@@ -60,12 +85,12 @@
* Deprecating class names like ParentChild in favor of namespaced names
like Parent::Child
## 2.1.0
-* 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)
+* 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)
## 2.0.3
* Fixes issue with validates_uniqueness_of when using an enum field as
the scope.