From 52181d801796391d6fda0582fd4a96c11abe4402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20Bo=CC=88ttger?= Date: Wed, 24 Apr 2013 13:05:49 +0200 Subject: [PATCH] keep it simple --- lib/aasm/persistence/active_record_persistence.rb | 1 - lib/aasm/persistence/base.rb | 4 ++++ lib/aasm/persistence/mongoid_persistence.rb | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) 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)