To turn off all deprecation warnings, just do the following:
ActiveSupport::Deprecation.silenced = true
Or, if you want to perform something other than spit out deprecation warnings you can re-route them however you want within a block:
ActiveSupport::Deprecation.behavior = Proc.new { |msg, stack| MyLogger.warn(msg) }
Or, if you want to be more granular, you can silence specific parts of your code that you know reference deprecated code:
def bad_action
ActiveSupport::Deprecation.silence { p "Referencing #{@cookies} is bad" }
end

1 comment:
Nice post ...
Would like to see more from you.
Post a Comment