Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

temporarily pass caller to deprecation messages

  • Loading branch information...
commit a7f171052ed2291b039d3610491a52dd4aa24614 1 parent bb30309
@mikz authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/formtastic/inputs/base.rb
View
5 lib/formtastic/inputs/base.rb
@@ -23,7 +23,7 @@ def initialize(builder, template, object, object_name, method, options)
# Usefull for deprecating options.
def warn_and_correct_option!(old_option_name, new_option_name)
if options.key?(old_option_name)
- ::ActiveSupport::Deprecation.warn("The :#{old_option_name} option is deprecated in favour of :#{new_option_name} and will be removed from Formtastic in the next version")
+ ::ActiveSupport::Deprecation.warn("The :#{old_option_name} option is deprecated in favour of :#{new_option_name} and will be removed from Formtastic in the next version", caller(6))
options[new_option_name] = options.delete(old_option_name)
end
end
@@ -31,7 +31,7 @@ def warn_and_correct_option!(old_option_name, new_option_name)
# Usefull for deprecating options.
def warn_deprecated_option!(old_option_name, instructions)
if options.key?(old_option_name)
- ::ActiveSupport::Deprecation.warn("The :#{old_option_name} option is deprecated in favour of `#{instructions}` and will be removed in the next version")
+ ::ActiveSupport::Deprecation.warn("The :#{old_option_name} option is deprecated in favour of `#{instructions}` and will be removed in the next version", caller(6))
end
end
@@ -78,4 +78,3 @@ def removed_option!(old_option_name)
end
end
end
-
Please sign in to comment.
Something went wrong with that request. Please try again.