aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/url_helper.rb
diff options
context:
space:
mode:
authorNikita Afanasenko <nikita@afanasenko.name>2012-10-29 19:22:59 +0400
committerNikita Afanasenko <nikita@afanasenko.name>2012-10-29 19:22:59 +0400
commit0b7067d8497c4d832b32233888ce973ab4357e5d (patch)
tree036be2c4e07d30287498a8de215550330039a176 /actionpack/lib/action_view/helpers/url_helper.rb
parent29b1dc273e1ad6b9e13bf48fe3f12047850f9554 (diff)
downloadrails-0b7067d8497c4d832b32233888ce973ab4357e5d.tar.gz
rails-0b7067d8497c4d832b32233888ce973ab4357e5d.tar.bz2
rails-0b7067d8497c4d832b32233888ce973ab4357e5d.zip
Provide a call stack for deprecation warnings where needed.
It's sometimes hard to quickly find where deprecated call was performed, especially in case of migrating between Rails versions. So this is an attempt to improve the call stack part of the warning message by providing caller explicitly.
Diffstat (limited to 'actionpack/lib/action_view/helpers/url_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index 5105d0e585..4d6367e66a 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -577,7 +577,9 @@ module ActionView
method = html_options.delete('method')
if confirm
- ActiveSupport::Deprecation.warn ":confirm option is deprecated and will be removed from Rails 4.1. Use ':data => { :confirm => \'Text\' }' instead"
+ message = ":confirm option is deprecated and will be removed from Rails 4.1. " /
+ "Use ':data => { :confirm => \'Text\' }' instead."
+ ActiveSupport::Deprecation.warn(message, caller)
html_options["data-confirm"] = confirm
end
@@ -585,7 +587,9 @@ module ActionView
add_method_to_attributes!(html_options, method) if method
if disable_with
- ActiveSupport::Deprecation.warn ":disable_with option is deprecated and will be removed from Rails 4.1. Use ':data => { :disable_with => \'Text\' }' instead"
+ message = ":disable_with option is deprecated and will be removed from Rails 4.1. " /
+ "Use ':data => { :disable_with => \'Text\' }' instead."
+ ActiveSupport::Deprecation.warn(message, caller)
html_options["data-disable-with"] = disable_with
end