diff options
author | Xavier Noria <fxn@hashref.com> | 2011-12-02 11:44:04 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-12-02 11:44:04 -0800 |
commit | 3a967806ad9cb8e319edf90a88dae1fb1eb35935 (patch) | |
tree | cde91b529e3cddd7cc4b5482debb491c5b2bee9a | |
parent | 15dab0d2f5acdfffca48d62b1f41c62c51dc74f0 (diff) | |
download | rails-3a967806ad9cb8e319edf90a88dae1fb1eb35935.tar.gz rails-3a967806ad9cb8e319edf90a88dae1fb1eb35935.tar.bz2 rails-3a967806ad9cb8e319edf90a88dae1fb1eb35935.zip |
yield > block.call
-rw-r--r-- | activerecord/lib/active_record/explain.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/explain.rb b/activerecord/lib/active_record/explain.rb index 1a4bf0bce2..b506108f21 100644 --- a/activerecord/lib/active_record/explain.rb +++ b/activerecord/lib/active_record/explain.rb @@ -29,7 +29,7 @@ module ActiveRecord Thread.current[LOGGING_QUERY_PLAN] = false end else - block.call + yield end end @@ -43,7 +43,7 @@ module ActiveRecord # Collects all queries executed while the passed block runs. Returns an # array with three elements, the result of the block, the strings with the # queries, and their respective bindings. - def collecting_sqls_for_explain(&block) # :nodoc: + def collecting_sqls_for_explain # :nodoc: sqls = [] binds = [] callback = lambda do |*args| @@ -56,7 +56,7 @@ module ActiveRecord result = nil ActiveSupport::Notifications.subscribed(callback, "sql.active_record") do - result = block.call + result = yield end [result, sqls, binds] |