Skip to content

Commit

Permalink
Styling
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3929 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Mar 18, 2006
1 parent 129a159 commit f38476d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions activerecord/lib/active_record/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,16 @@ def migrate(direction)
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
Expand All @@ -224,11 +224,12 @@ def singleton_method_added(sym) #:nodoc:

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
Expand Down Expand Up @@ -277,6 +278,7 @@ class Migrator#:nodoc:
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)
Expand Down

0 comments on commit f38476d

Please sign in to comment.