[Rails 3.2.8] ActiveSupport::BufferedLogger extension, undefined_method

29 views
Skip to first unread message

Erwin

unread,
Oct 25, 2012, 6:07:57 AM10/25/12
to rubyonra...@googlegroups.com
I tried to extend it , with this class , loaded at config time :
  config.autoload_paths += Dir["#{config.root}/lib", "#{config.root}/lib/**/", "#{config.root}/app/inputs"]

lib/extension.rb
class ActiveSupport::BufferedLogger
  def detailed_error(e)
    error(e.message)
    e.backtrace.each{|line| error line }
  end
end

but calling it in my controller 

rescue ActiveRecord::RecordInvalid
   logger.detailed_error($!)

raises an error =>   undefined method `detailed_error' for #<Logger:0x007fb8ecaabcc8>
what's wrong with my class definition ?

thanks for feedback

Reply all
Reply to author
Forward
0 new messages