diff --git a/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb b/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb index 7510462bd0c..9648a80cb51 100644 --- a/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb +++ b/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb @@ -435,7 +435,7 @@ def set_new_version # Gets the next available version for the current record, or 1 for a new record def next_version return 1 if new_record? - (versions.calculate(:max, :version) || 0) + 1 + (versions.maximum(:version) || 0) + 1 end # clears current changed attributes. Called after save.