Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 532f9d484cb222b452c059d8e1088910fc404a25 1 parent b95b09f
Jamis Buck jamis authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 activerecord/lib/active_record/migration.rb
8 activerecord/lib/active_record/migration.rb
View
@@ -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?
Please sign in to comment.
Something went wrong with that request. Please try again.