aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorwangjohn <wangjohn@mit.edu>2013-03-19 22:09:17 -0400
committerwangjohn <wangjohn@mit.edu>2013-03-19 22:11:48 -0400
commit7952eafcfcbfa01a0332a1d196398f42eef5127f (patch)
tree5d84e448d92aca26f33b2bc6008c9503b21ba732 /activerecord/lib
parent730f725509f7c504837510a466bd693551bacb82 (diff)
downloadrails-7952eafcfcbfa01a0332a1d196398f42eef5127f.tar.gz
rails-7952eafcfcbfa01a0332a1d196398f42eef5127f.tar.bz2
rails-7952eafcfcbfa01a0332a1d196398f42eef5127f.zip
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).
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/migration.rb2
1 files changed, 1 insertions, 1 deletions
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