lib/acts_as_versioned.rb
def delete_newer_versions
          self.class.versioned_class.delete_all ["version > ? AND #{self.class.versioned_foreign_key} = ?", version, id]
          # reload the association so it's accurate after the delete
          self.versions(true)
        end
# Remove any versions that are newer than the current version
Remove any versions that are newer than the current version
Remove any versions that are newer than the current version
def delete_newer_versions
          self.class.versioned_class.delete_all ["version > ? AND #{self.class.versioned_foreign_key} = ?", version, id]
          self.versions(true)
        end
def delete_newer_versions self . class . versioned_class . delete_all [ "version > ? AND #{self.class.versioned_foreign_key} = ?" , version , id ] self . versions ( true ) end
Remove any versions that are newer than the current version
Remove any versions that are newer than the current version
# reload the association so it's accurate after the delete