Sha256: e4d5d13475b998c7a8ab00177aa81eb27dfddfe52122063f5b43bc00d8a6a705
Contents?: true
Size: 827 Bytes
Versions: 26
Compression:
Stored size: 827 Bytes
Contents
class WithEnumWithoutColumn < ActiveRecord::Base include AASM if ActiveRecord::VERSION::MAJOR >= 4 && ActiveRecord::VERSION::MINOR >= 1 # won't work with Rails <= 4.1 enum status: { opened: 0, closed: 1 } end aasm :column => :status do state :closed, initial: true state :opened event :view do transitions :to => :opened, :from => :closed end end end class MultipleWithEnumWithoutColumn < ActiveRecord::Base include AASM if ActiveRecord::VERSION::MAJOR >= 4 && ActiveRecord::VERSION::MINOR >= 1 # won't work with Rails <= 4.1 enum status: { opened: 0, closed: 1 } end aasm :left, :column => :status do state :closed, initial: true state :opened event :view do transitions :to => :opened, :from => :closed end end end
Version data entries
26 entries across 26 versions & 1 rubygems