Very often in Rails 3, when I get a deprecation warning, the line reference I get is in the Rails framework instead of the actual deprecated line!
For example, I try to save a user model :
irb(main):006:0> user.save
DEPRECATION WARNING: save(true) is deprecated, 开发者_StackOverflow中文版please give save(:validate => true) instead. (called from save at /home/novagile/www/novagolf/releases/20100820143809/vendor/bundle/ruby/1.8/gems/activerecord-3.0.0.rc/lib/active_record/validations.rb:43)
=> false
Great! How should I know where exactly the faulty save(true) comes from? I've "grep"ed my project without success so it may be in one of the gem I use...
Have you got full logging turned on? If so - check your log-files for a full backtrace. The full backtrace should point out the full calling-stack including the line of your code that caused the issue.
精彩评论