Sha256: b618e7cc8c12b2c14b87634f37c9011b4425baa2af589972c73029aec83464d2
Contents?: true
Size: 572 Bytes
Versions: 9
Compression:
Stored size: 572 Bytes
Contents
module AASM::Persistence # Checks to see this class or any of it's superclasses inherit from # ActiveRecord::Base and if so includes ActiveRecordPersistence def self.set_persistence(base) # Use a fancier auto-loading thingy, perhaps. When there are more persistence engines. hierarchy = base.ancestors.map {|klass| klass.to_s} if hierarchy.include?("ActiveRecord::Base") require File.join(File.dirname(__FILE__), 'persistence', 'active_record_persistence') base.send(:include, AASM::Persistence::ActiveRecordPersistence) end end end
Version data entries
9 entries across 9 versions & 3 rubygems