Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Dec 28, 2014
  1. Final 4.0 changelog updates

  2. Rails 3.2 and Ruby 2.2.0 are not compatible

    This may be addressed in the future, but for now they do not play well
    together and travis is showing failures.
  3. Adds support for Ruby 2.2.0

    There was a deprecation warning that comparison with invalid objects
    will not be supported in the future, so this addresses that issue by
    returning nil if an object is not a classy enum.
Commits on Dec 22, 2014
  1. Merge branch 'final-4.0.0'

Commits on Dec 20, 2014
Commits on Dec 11, 2014
  1. Merge pull request #49 from brettchalupa/document-testing-classy_enums

    Add README section on testing ClassyEnums
  2. Brett Chalupa

    Add README section on testing ClassyEnums

    brettchalupa authored brettchalupa committed
    Add some examples of how to test enums and access the owner to the README. The
    examples use Minitest.
Commits on Nov 1, 2014
  1. A few minor doc updates

Commits on Oct 24, 2014
  1. 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.
Commits on Oct 22, 2014
  1. Bumps version to 4.0.0.beta1

    [ci skip]
  2. Merge branch 'version-4.0'

  3. Updates spec to ensure the enum option is covered

    I thought about removing this in favor of class_name, but it's been
    around for so long that it will cause some upgrade headaches for people
    without much benefit.
  4. Revert "Removes support for Ruby < 2.0"

    This reverts commit 9db4172.
    After thinking about this for a bit and looking at some of the recent
    surveys on Ruby usage, it seems like a lot of people are still using
    1.9.3. Since there's not a huge benefit to dropping support for 1.9.3,
    it will stay for now.
  5. Allow comparison with enum classes

    This addresses the issue of using enums in a case statement and also
    makes the API more predictable.
Commits on Oct 13, 2014
Commits on Oct 5, 2014
  1. Removes allow_blank option from

    This was also used originally to support Formtastic and is no longer
  2. Removes support for Ruby < 2.0

    Experimenting with keyword args and they don't work in 1.9.3. Not sure
    if it's worth removing support for < 2.0, but that seems like a pretty
    old version at this point.
  3. Removes serialize_as_json option from classy_enum_attr

    This was originally added as a way to expose a JSON version of the enum
    instance, but it doesn't really give you anything. If you want to
    serialize the enum instances, you can simply override as_json in the
    enum classes.
  4. No longer needs to check for anonymous classes

    This was left over from the null object functionality that was
    previously removed.
  5. Removes null object from

    The null object was originally added to retain backwards compatibility
    with existing Formtastic support. It was a pain to maintain support for
    Formtastic, so support was removed, but the null object remained. The
    null object breaks expected behavior if you're expecting the value to be
    nil since it does not evaluate to a falsy value.
    Previously, blank values had the same methods as enums:
      alarm = nil)
      alarm.priority.nil? # => true
      alarm.priority.low? # => false
    Now, the value will be nil:
      alarm = nil)
      alarm.priority.nil? # => true
      alarm.priority.low? # NoMethodError: undefined method `low?' for nil:NilClass
      alarm.priority && alarm.priority.low? # => nil
Commits on Oct 4, 2014
  1. Changes classy_enum_attr preferred argument to class_name

    The class_name argument was added to bring the API closer to how you
    declare class name's with other Rails functionality. To try and prevent
    confusion, the other 'enum' argument which did the same thing, has been
    removed from the documentation, but is still valid.
  2. Removes support for Ruby 1.8.7

    Mostly just converting hashes and lambdas to post 1.9 syntax
  3. Active Record models must explicitly include ClassyEnum

    From my experience, it's rare to have more than a few models use
    ClassyEnum in a project. By requiring all models to explicitly include
    (or extend) ClassyEnum::ActiveRecord, it keeps other models clean and
    makes it more obvious where classy_enum_attr is coming from.
  4. Fixes issues and warnings with i18n tests

    Since Rails 3.2.16 the enforce_available_locales setting should be set
    to true. This mimics that behavior.
Commits on Oct 1, 2014
Commits on Jun 29, 2014
  1. Merge branch 'rails-4.1'

Commits on Jun 15, 2014
  1. Prepping for 3.5.0 release

Commits on May 22, 2014
Something went wrong with that request. Please try again.