aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-10-29 08:42:16 -0700
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-10-29 08:42:16 -0700
commitd1c95d912ec39e7e374aee605a1d6fb11f8521d7 (patch)
tree9ec15855e1cab91c346d5a09e6adb593c7585608 /actionpack/lib/action_controller
parent72e6fb005fbdd211883282fc761d3ded23ef7fbb (diff)
parent0b7067d8497c4d832b32233888ce973ab4357e5d (diff)
downloadrails-d1c95d912ec39e7e374aee605a1d6fb11f8521d7.tar.gz
rails-d1c95d912ec39e7e374aee605a1d6fb11f8521d7.tar.bz2
rails-d1c95d912ec39e7e374aee605a1d6fb11f8521d7.zip
Merge pull request #8063 from nikitug/deprecation_caller_context
Provide a call stack for deprecation warnings where needed.
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/record_identifier.rb4
-rw-r--r--actionpack/lib/action_controller/test_case.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/record_identifier.rb b/actionpack/lib/action_controller/record_identifier.rb
index bffd2a02d0..90b69879e5 100644
--- a/actionpack/lib/action_controller/record_identifier.rb
+++ b/actionpack/lib/action_controller/record_identifier.rb
@@ -8,12 +8,12 @@ module ActionController
'ActionView::RecodIdentifier module.'
def dom_id(record, prefix = nil)
- ActiveSupport::Deprecation.warn 'dom_id ' + MESSAGE
+ ActiveSupport::Deprecation.warn('dom_id ' + MESSAGE, caller)
ActionView::RecordIdentifier.dom_id(record, prefix)
end
def dom_class(record, prefix = nil)
- ActiveSupport::Deprecation.warn 'dom_class ' + MESSAGE
+ ActiveSupport::Deprecation.warn('dom_class ' + MESSAGE, caller)
ActionView::RecordIdentifier.dom_class(record, prefix)
end
end
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index d911d47a1d..7529993a0e 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -476,7 +476,7 @@ module ActionController
def process(action, http_method = 'GET', *args)
check_required_ivars
- http_method, args = handle_old_process_api(http_method, args)
+ http_method, args = handle_old_process_api(http_method, args, caller)
if args.first.is_a?(String) && http_method != 'HEAD'
@request.env['RAW_POST_DATA'] = args.shift
@@ -579,10 +579,10 @@ module ActionController
end
end
- def handle_old_process_api(http_method, args)
+ def handle_old_process_api(http_method, args, callstack)
# 4.0: Remove this method.
if http_method.is_a?(Hash)
- ActiveSupport::Deprecation.warn("TestCase#process now expects the HTTP method as second argument: process(action, http_method, params, session, flash)")
+ ActiveSupport::Deprecation.warn("TestCase#process now expects the HTTP method as second argument: process(action, http_method, params, session, flash)", callstack)
args.unshift(http_method)
http_method = args.last.is_a?(String) ? args.last : "GET"
end