Changeset [1b422a537f3700da140128bf94486431bc89b9e7] by James Herdman
Revision 1b422a537f3700da140128bf94486431bc89b9e7,
committed 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...
3 changed files
-
M
CHANGELOG.md -
M
lib/aasm/base.rb -
M
spec/unit/simple_example_spec.rb