From 7952eafcfcbfa01a0332a1d196398f42eef5127f Mon Sep 17 00:00:00 2001 From: wangjohn Date: Tue, 19 Mar 2013 22:09:17 -0400 Subject: Changed the call to .sort.last to .max when computing the migration version. You do not actually need to sort everything (incurs more cost than just a simple max). --- activerecord/lib/active_record/migration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 5d7762ec3a..27d37766b7 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -858,7 +858,7 @@ module ActiveRecord end def current_version - migrated.sort.last || 0 + migrated.max || 0 end def current_migration -- cgit v1.2.3