diff --git a/lib/aasm/persistence/active_record_persistence.rb b/lib/aasm/persistence/active_record_persistence.rb index 2e5c8e0..544e17b 100644 --- a/lib/aasm/persistence/active_record_persistence.rb +++ b/lib/aasm/persistence/active_record_persistence.rb @@ -32,7 +32,6 @@ module AASM # def self.included(base) base.send(:include, AASM::Persistence::Base) - base.extend AASM::Persistence::Base::ClassMethods base.extend AASM::Persistence::ActiveRecordPersistence::ClassMethods base.send(:include, AASM::Persistence::ActiveRecordPersistence::InstanceMethods) base.send(:include, AASM::Persistence::ActiveRecordPersistence::WriteState) unless base.method_defined?(:aasm_write_state) diff --git a/lib/aasm/persistence/base.rb b/lib/aasm/persistence/base.rb index 5867a40..ce5fc3f 100644 --- a/lib/aasm/persistence/base.rb +++ b/lib/aasm/persistence/base.rb @@ -2,6 +2,10 @@ module AASM module Persistence module Base + def self.included(base) #:nodoc: + base.extend ClassMethods + end + # Returns the value of the aasm_column - called from aasm.current_state # # If it's a new record, and the aasm state column is blank it returns the initial state diff --git a/lib/aasm/persistence/mongoid_persistence.rb b/lib/aasm/persistence/mongoid_persistence.rb index 07f319e..f4f10b0 100644 --- a/lib/aasm/persistence/mongoid_persistence.rb +++ b/lib/aasm/persistence/mongoid_persistence.rb @@ -34,7 +34,6 @@ module AASM # def self.included(base) base.send(:include, AASM::Persistence::Base) - base.extend AASM::Persistence::Base::ClassMethods base.extend AASM::Persistence::MongoidPersistence::ClassMethods base.send(:include, AASM::Persistence::MongoidPersistence::InstanceMethods) base.send(:include, AASM::Persistence::MongoidPersistence::WriteState) unless base.method_defined?(:aasm_write_state)