From 758cc2f2e6eda211d6e38c467ce56532a2e23600 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 14 Oct 2013 17:07:17 +0000 Subject: [PATCH] Fixed that WikiContent#next_version raises a comparison of Symbol with Arel::Table failed error (#14773). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12222 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b63c891e4..618cf07c5 100644 --- a/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb +++ b/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb @@ -437,7 +437,7 @@ module ActiveRecord #:nodoc: # 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.