Module: Stateflow::Persistence::Mongoid

Defined in:
lib/stateflow/persistence/mongoid.rb

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

.install(base) ⇒ Object



4
5
6
7
8
9
# File 'lib/stateflow/persistence/mongoid.rb', line 4

def self.install(base)
  ActiveSupport::Deprecation.silence do
    base.respond_to?(:before_validation_on_create) ? base.before_validation_on_create(:ensure_initial_state) : base.before_validation(:ensure_initial_state, :on => :create)
    base.send :include, InstanceMethods
  end
end