diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 16:28:40 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 16:28:40 +0000 |
commit | f38476ddd2709f3ab0aafc68a5afb96724babce7 (patch) | |
tree | f038be60a2db3a8a65a860ee35d248132cedebca /activerecord/lib/active_record | |
parent | 129a159d1247b2bc9cc791a81ef3485e5b061648 (diff) | |
download | rails-f38476ddd2709f3ab0aafc68a5afb96724babce7.tar.gz rails-f38476ddd2709f3ab0aafc68a5afb96724babce7.tar.bz2 rails-f38476ddd2709f3ab0aafc68a5afb96724babce7.zip |
Styling
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3929 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index b911a76899..47a6ed7086 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -201,16 +201,16 @@ module ActiveRecord return unless respond_to?(direction) case direction - when :up then announce "migrating" - when :down then announce "reverting" + when :up then announce "migrating" + when :down then announce "reverting" end result = nil time = Benchmark.measure { result = send("real_#{direction}") } case direction - when :up then announce "migrated (%.4fs)" % time.real; write - when :down then announce "reverted (%.4fs)" % time.real; write + when :up then announce "migrated (%.4fs)" % time.real; write + when :down then announce "reverted (%.4fs)" % time.real; write end result @@ -224,11 +224,12 @@ module ActiveRecord begin @ignore_new_methods = true + case sym - when :up, :down - klass = (class << self; self; end) - klass.send(:alias_method, "real_#{sym}", sym) - klass.send(:alias_method, sym, "#{sym}_using_benchmarks") + when :up, :down + klass = (class << self; self; end) + klass.send(:alias_method, "real_#{sym}", sym) + klass.send(:alias_method, sym, "#{sym}_using_benchmarks") end ensure @ignore_new_methods = false @@ -277,6 +278,7 @@ module ActiveRecord class << self def migrate(migrations_path, target_version = nil) Base.connection.initialize_schema_information + case when target_version.nil?, current_version < target_version up(migrations_path, target_version) |