lib/acts_as_versioned.rb
def clear_old_versions
          return if self.class.max_version_limit == 0
          excess_baggage = send(self.class.version_column).to_i - self.class.max_version_limit
          if excess_baggage > 0
            self.class.versioned_class.delete_all ["version <= ? and #{self.class.versioned_foreign_key} = ?", excess_baggage, id]
          end
        end
# Clears old revisions if a limit is set with the :limit option in <tt>acts_as_versioned</tt>.
# Override this method to set your own criteria for clearing old versions.
Clears old revisions if a limit is set with the :limit option in acts_as_versioned.
Override this method to set your own criteria for clearing old versions.
Clears old revisions if a limit is set with the : limit option in acts_as_versioned . Override this method to set your own criteria for clearing old versions .
def clear_old_versions
          return if self.class.max_version_limit == 0
          excess_baggage = send(self.class.version_column).to_i - self.class.max_version_limit
          if excess_baggage > 0
            self.class.versioned_class.delete_all ["version <= ? and #{self.class.versioned_foreign_key} = ?", excess_baggage, id]
          end
        end
def clear_old_versions return if self . class . max_version_limit == 0 excess_baggage = send ( self . class . version_column ) . to_i - self . class . max_version_limit if excess_baggage > 0 self . class . versioned_class . delete_all [ "version <= ? and #{self.class.versioned_foreign_key} = ?" , excess_baggage , id ] end end
Clears old revisions if a limit is set with the :limit option in <tt>acts_as_versioned</tt>.
Clears old revisions if a limit is set with the : limit option in <tt > acts_as_versioned< / tt > .