module AASM::Persistence::OhmPersistence
Public Class Methods
included(base)
click to toggle source
This method:
-
extends the model with
ClassMethods
-
includes
InstanceMethods
Adds
def before_create aasm_ensure_initial_state end
As a result, you need to call super if you are going to define before_create yourself
class Foo < Ohm::Model include AASM include AASM::Persistence::OhmPersistence def before_create super # your code here end end
# File lib/aasm/persistence/ohm_persistence.rb, line 30 def self.included(base) base.send(:include, AASM::Persistence::Base) base.extend AASM::Persistence::OhmPersistence::ClassMethods base.send(:include, Ohm::Callbacks) base.send(:include, AASM::Persistence::OhmPersistence::InstanceMethods) end