Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does one find Rails deprecation warnings?

How can I know that I'm seeing all deprecation warnings?

Will they all print out at boot time? So firing up the console and viewing the output should be sufficient?

(if so, I don't have any. w00t!)

Thanks, John

like image 669
John Bachir Avatar asked Dec 03 '25 01:12

John Bachir


1 Answers

Will they all print out at boot time? So firing up the console and viewing the output should be sufficient?

No; you wouldn't see some kinds of deprecation warnings until runtime. For instance, if you try to use find_all instead of find(:all), Ruby doesn't know you're using find_all until you actually hit that line.

Ruby is a dynamic language, so it would be very hard to prove that all deprecated code is actually gone; bindings to the "bad" code can be deferred and thus there's no way to guarantee that it's called in the first place. Your best bet is a static-analysis tool that reads your code in the abstract and errs on the side of false positives.

like image 166
John Feminella Avatar answered Dec 05 '25 13:12

John Feminella



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!