Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install enum_aasm
Basically the same usage as the original AASM. The only difference is that the
:column option is mandatory.
Use this option to specify the name of the enumerated attribute. Note that scopes are not defined
by the state machine as PowerEnum already handles this functionality.
require 'enum_aasm' class Fruit < ActiveRecord::Base include AASM has_enumerated :fruit_color aasm :column => :fruit_color do state :green, :initial => true end end
Distributed under the MIT license. See LICENSE.txt for details.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
Copyright 2014 Arthur Shagall