aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-03-09 18:38:39 +0000
committerJamis Buck <jamis@37signals.com>2006-03-09 18:38:39 +0000
commit532f9d484cb222b452c059d8e1088910fc404a25 (patch)
treee3a428b68b4f9dcf8d89f4475275a77edd264e77 /activerecord
parentb95b09f32daf4da5eb9986ba3444f7dd968a72a1 (diff)
downloadrails-532f9d484cb222b452c059d8e1088910fc404a25.tar.gz
rails-532f9d484cb222b452c059d8e1088910fc404a25.tar.bz2
rails-532f9d484cb222b452c059d8e1088910fc404a25.zip
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
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/migration.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb
index 262a1fb43e..9b7954dcdf 100644
--- a/activerecord/lib/active_record/migration.rb
+++ b/activerecord/lib/active_record/migration.rb
@@ -256,6 +256,14 @@ module ActiveRecord
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?