diff options
Diffstat (limited to 'actionpack/lib/action_view/helpers')
6 files changed, 29 insertions, 13 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index 4eac6514df..9a2b5ae16a 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -125,7 +125,7 @@ module ActionView "the :type option key. This behavior is deprecated and will be remove in Rails 4.1. You should pass " + ":type option explicitly if you want to use other types, for example: " + "auto_discovery_link_tag(:xml, '/feed.xml', :type => 'application/xml')" - ActiveSupport::Deprecation.warn message + ActiveSupport::Deprecation.warn(message, caller) end tag( diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index b87c2e936f..1a0ce29756 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -1181,8 +1181,8 @@ module ActionView def initialize(object_name, object, template, options, block=nil) if block - ActiveSupport::Deprecation.warn( - "Giving a block to FormBuilder is deprecated and has no effect anymore.") + message = "Giving a block to FormBuilder is deprecated and has no effect anymore." + ActiveSupport::Deprecation.warn(message, caller) end @nested_child_index = {} diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index 2bb526a539..6b3d80cbf0 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -519,7 +519,9 @@ module ActionView else prompt = options options = {} - ActiveSupport::Deprecation.warn "Passing the prompt to grouped_options_for_select as an argument is deprecated. Please use an options hash like `{ prompt: #{prompt.inspect} }`." + message = "Passing the prompt to grouped_options_for_select as an argument is deprecated. " / + "Please use an options hash like `{ prompt: #{prompt.inspect} }`." + ActiveSupport::Deprecation.warn(message, caller) end body = "".html_safe diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index f16e33d08d..c92b38e2b9 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -425,13 +425,17 @@ module ActionView options = options.stringify_keys if disable_with = options.delete("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) options["data-disable-with"] = disable_with end if confirm = options.delete("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) options["data-confirm"] = confirm end @@ -483,13 +487,17 @@ module ActionView options = options.stringify_keys if disable_with = options.delete("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) options["data-disable-with"] = disable_with end if confirm = options.delete("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) options["data-confirm"] = confirm end @@ -533,7 +541,9 @@ module ActionView options = options.stringify_keys if confirm = options.delete("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) options["data-confirm"] = confirm end diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 7bf659d5f2..6be35168dd 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -80,7 +80,7 @@ module ActionView def button_to_function(name, function=nil, html_options={}) message = "button_to_function is deprecated and will be removed from Rails 4.1. We recomend to use Unobtrusive JavaScript instead. " + "See http://guides.rubyonrails.org/working_with_javascript_in_rails.html#unobtrusive-javascript" - ActiveSupport::Deprecation.warn message + ActiveSupport::Deprecation.warn(message, caller) onclick = "#{"#{html_options[:onclick]}; " if html_options[:onclick]}#{function};" @@ -102,7 +102,7 @@ module ActionView def link_to_function(name, function, html_options={}) message = "link_to_function is deprecated and will be removed from Rails 4.1. We recomend to use Unobtrusive JavaScript instead. " + "See http://guides.rubyonrails.org/working_with_javascript_in_rails.html#unobtrusive-javascript" - ActiveSupport::Deprecation.warn message + ActiveSupport::Deprecation.warn(message, caller) onclick = "#{"#{html_options[:onclick]}; " if html_options[:onclick]}#{function}; return false;" href = html_options[:href] || '#' 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 |