def store_revision
      if new_record? || @revisions_disabled
        return yield
      else
        retval = nil
        revision = nil
        begin
          revision_record_class.transaction do
            begin
              read_only = self.class.first(:conditions => {self.class.primary_key => self.id}, :readonly => true)
              if read_only
                revision = read_only.create_revision!
                truncate_revisions!
              end
            rescue => e
              logger.warn(e) if logger
            end
            
            disable_revisioning do
              retval = yield
            end
            
            raise ActiveRecord::Rollback unless errors.empty?
            
            revision.trash! if destroyed?
          end
        rescue => e
          # In case the database doesn't support transactions
          if revision
            begin
              revision.destroy
            rescue => e
              logger.warn(e) if logger
            end
          end
          raise e
        end
        return retval
      end
    end
def store_revision
      if new_record? || @revisions_disabled
        return yield
      else
        retval = nil
        revision = nil
        begin
          revision_record_class.transaction do
            begin
              read_only = self.class.first(:conditions => {self.class.primary_key => self.id}, :readonly => true)
              if read_only
                revision = read_only.create_revision!
                truncate_revisions!
              end
            rescue => e
              logger.warn(e) if logger
            end
            
            disable_revisioning do
              retval = yield
            end
            
            raise ActiveRecord::Rollback unless errors.empty?
            
            revision.trash! if destroyed?
          end
        rescue => e
          # In case the database doesn't support transactions
          if revision
            begin
              revision.destroy
            rescue => e
              logger.warn(e) if logger
            end
          end
          raise e
        end
        return retval
      end
    end
Call this method to implement revisioning. The object changes should happen inside the block.