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/migration.rb') 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 From b0ac116a965db7a84758da42350e7a328c94a50d Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Wed, 27 Mar 2013 21:14:58 +0530 Subject: Fixed typos in activerecord --- activerecord/lib/active_record/migration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/migration.rb') diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 27d37766b7..d3edcf3cdb 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -102,7 +102,7 @@ module ActiveRecord # table definition. # * drop_table(name): Drops the table called +name+. # * change_table(name, options): Allows to make column alterations to - # the table called +name+. It makes the table object availabe to a block that + # the table called +name+. It makes the table object available to a block that # can then add/remove columns, indexes or foreign keys to it. # * rename_table(old_name, new_name): Renames the table called +old_name+ # to +new_name+. -- cgit v1.2.3