Permalink
Browse files

Add suppress_messages to migrations, to temporarily turn off verbose …

…messages

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3827 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent b95b09f commit 532f9d484cb222b452c059d8e1088910fc404a25 @jamis jamis committed Mar 9, 2006
Showing with 8 additions and 0 deletions.
  1. +8 −0 activerecord/lib/active_record/migration.rb
View
8 activerecord/lib/active_record/migration.rb
@@ -256,6 +256,14 @@ def say_with_time(message)
result
end
+ def suppress_messages
+ save = verbose
+ self.verbose = false
+ yield
+ ensure
+ self.verbose = save
+ end
+
def method_missing(method, *arguments, &block)
say_with_time "#{method}(#{arguments.map { |a| a.inspect }.join(", ")})" do
arguments[0] = Migrator.proper_table_name(arguments.first) unless arguments.empty?

0 comments on commit 532f9d4

Please sign in to comment.