diff options
author | Nikita Afanasenko <nikita@afanasenko.name> | 2012-10-29 19:22:59 +0400 |
---|---|---|
committer | Nikita Afanasenko <nikita@afanasenko.name> | 2012-10-29 19:22:59 +0400 |
commit | 0b7067d8497c4d832b32233888ce973ab4357e5d (patch) | |
tree | 036be2c4e07d30287498a8de215550330039a176 /actionpack/lib/action_view/helpers/form_options_helper.rb | |
parent | 29b1dc273e1ad6b9e13bf48fe3f12047850f9554 (diff) | |
download | rails-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/form_options_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_options_helper.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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 |