Changeset [1b422a537f3700da140128bf94486431bc89b9e7] by James Herdman

March 15th, 2013 @ 12:07 AM

AASM defines constants for each state name

Example:

class Foo include AASM

aasm do
  state :initialized
  state :calculated
  state :finalized
end

end

Foo::STATE_INITIALIZED => :initialized Foo::STATE_CALCULATED => :calculated

You may find this useful in custom scopes when using ActiveRecord, or
when testing your classes.
https://github.com/aasm/aasm/commit/1b422a537f3700da140128bf9448643...

Committed by James Herdman

  • M CHANGELOG.md
  • M lib/aasm/base.rb
  • M spec/unit/simple_example_spec.rb
New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Library for adding state machines to Ruby classes. Includes persistence layers for things like ActiveRecord. Formerly known as acts_as_state_machine.