# File lib/archivist/base.rb, line 64 def acts_as_archive(options={}) has_archive(options) end
# File lib/archivist/base.rb, line 17 def has_archive(options={}) options = DEFAULT_OPTIONS.merge(options) options[:allow_multiple_archives] = true if options[:associate_with_original] class_eval alias_method :delete!, :delete class << self alias_method :delete_all!, :delete_all end def self.archive_indexes #{Array(options[:indexes]).collect{|i| i.to_s}.inspect} end def self.archive_options #{options.inspect} end def self.has_archive? true end def self.acts_as_archive? warn "DEPRECATION WARNING: #acts_as_archive is provided for compatibility with AAA and will be removed soon, please use has_archive?" has_archive? end class Archive < ActiveRecord::Base self.record_timestamps = false self.table_name = "archived_#{self.table_name}" #{build_serialization_strings(self.serialized_attributes)} #{build_belongs_to_association(options[:associate_with_original])} #{build_inclusion_strings(options[:included_modules])} include Archivist::ArchiveMethods end #{build_has_many_association(options[:associate_with_original])} #{build_copy_self_to_archive(options[:allow_multiple_archives])} include InstanceMethods extend ClassExtensions include DB end
Generated with the Darkfish Rdoc Generator 2.