Permalink
Browse files

temporarily pass caller to deprecation messages

  • Loading branch information...
1 parent bb30309 commit a7f171052ed2291b039d3610491a52dd4aa24614 @mikz committed Feb 26, 2013
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/formtastic/inputs/base.rb
View
5 lib/formtastic/inputs/base.rb
@@ -23,15 +23,15 @@ 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
# 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
-

0 comments on commit a7f1710

Please sign in to comment.