def acts_as_revisionable(options = {})
      class_attribute :acts_as_revisionable_options, :instance_writer => false, :instance_reader => false
      defaults = {:class_name => "ActsAsRevisionable::RevisionRecord"}
      self.acts_as_revisionable_options = defaults.merge(options)
      acts_as_revisionable_options[:class_name] = acts_as_revisionable_options[:class_name].name if acts_as_revisionable_options[:class_name].is_a?(Class)
      extend ClassMethods
      include InstanceMethods
      class_name = acts_as_revisionable_options[:class_name].to_s if acts_as_revisionable_options[:class_name]
      has_many_options = {:as => :revisionable, :order => 'revision DESC', :class_name => class_name}
      has_many_options[:dependent] = :destroy unless options[:dependent] == :keep
      has_many :revision_records, has_many_options
      alias_method_chain :update, :revision if options[:on_update]
      alias_method_chain :destroy, :revision if options[:on_destroy]
    end
def acts_as_revisionable(options = {})
      class_attribute :acts_as_revisionable_options, :instance_writer => false, :instance_reader => false
      defaults = {:class_name => "ActsAsRevisionable::RevisionRecord"}
      self.acts_as_revisionable_options = defaults.merge(options)
      acts_as_revisionable_options[:class_name] = acts_as_revisionable_options[:class_name].name if acts_as_revisionable_options[:class_name].is_a?(Class)
      extend ClassMethods
      include InstanceMethods
      class_name = acts_as_revisionable_options[:class_name].to_s if acts_as_revisionable_options[:class_name]
      has_many_options = {:as => :revisionable, :order => 'revision DESC', :class_name => class_name}
      has_many_options[:dependent] = :destroy unless options[:dependent] == :keep
      has_many :revision_records, has_many_options
      alias_method_chain :update, :revision if options[:on_update]
      alias_method_chain :destroy, :revision if options[:on_destroy]
    end
Calling acts_as_revisionable will inject the revisionable behavior into the class. Specifying a :limit option
 will limit the number of revisions that are kept per record. Specifying :minimum_age will ensure that revisions are
 kept for at least a certain amount of time (i.e. 2.weeks). Associations to be revisioned can be specified with
 the :associations option as an array of association names. To specify associations of associations, use a hash
 for that association with the association name as the key and the value as an array of sub associations.
 For instance, this declaration will revision <tt>:tags</tt>, <tt>:comments</tt>, as well as the
 <tt>:ratings</tt> association on <tt>:comments</tt>:

   :associations => [:tags, {:comments => [:ratings]}]

 You can also pass an options of <tt>:on_update => true</tt> to automatically enable revisioning on every update.
 Otherwise you will need to perform your updates in a store_revision block. The reason for this is so that
 revisions for complex models with associations can be better controlled.

 You can keep a revisions of deleted records by passing <tt>:dependent => :keep</tt>. When a record is destroyed,
 an additional revision will be created and marked as trash. Trash records can be deleted by calling the
 <tt>empty_trash</tt> method. You can set <tt>:on_destroy => true</tt> to automatically create the trash revision
 whenever a record is destroyed. It is recommended that you turn both of these features on.

 Revision records can be extended to include other fields as needed and set with the <tt>:meta</tt> option.
 In order to extend a revision record, you must add columns to the database table. The values of the <tt>:meta</tt>
 option hash will be provided to the newly created revision record.

   acts_as_revisionable :meta => {
     :updated_by => :last_updated_by,
     :label => lambda{|record| "Updated by #{record.updated_by} at #{record.updated_at}"},
     :version => 1
   }

 As a shortcut, you can can also just pass an attribute name or array of attribute names to copy to the revision
 record.

   acts_as_revisionable :meta => :updated_by

 The values to the <tt>:meta</tt> hash can be either symbols or Procs. If it is a symbol, the method
 so named will be called on the record being revisioned. If it is a Proc, it will be called with the
 record as the argument. Any other class will be sent directly to the revision record.

 You can also use a subclass of RevisionRecord if desired so that you can add your own model logic as
 necessary. To specify a different class to use for revision records, simply subclass RevisionRecord and
 provide the class name to the <tt>:class_name</tt> option.

   acts_as_revisionable :class_name => "MyRevisionRecord"

 A has_many :revision_records will also be added to the model for accessing the revisions.