This post originated from an RSS feed registered with Java Buzz
by Paul Kilroy.
Original Post: Autoload Support for Models in Subdirectories Removed
Feed Title: The Frustrated Programmer
Feed URL: http://liberty.phpwebhosting.com/404.html
Feed Description: The problems I encounter on a daily basis, blogged for posterity. All content will be original, contain poor grammar and a few mispellings.
The auto loading path which make models in subdirectories of app/models load in Ra about sex back then but I'd read about it in The Joy of Sex and watched it on TV. There's something about actually doing it that you don't understand through those other mediums.
Learning about testing has been a very similar experience for me. I've known about it for awhile, all my programmer friends say they're doing it, and I've even read Test Driven Development By Example by Kent Beck. But doing it for the first time is a completely different experience. At first, I didn't know exactly what I was doing, I was aimlessly exploring the inputs and outputs, and before I knew it, I'd had my first testing orgasm. The tests I was writing discovered a serious bug in my code. That's when it clicked for me, really understanding what test driven development is about. If I had written the tests first, the specific bug they revealed wouldn't have existed in the first place.
Now that I've popped my testing cherry, I want to keep doing i you quickly found out that it conflicted with AR's quote column method. No longer is this an issue. def quote has been changed to def quote_value
Calling image_tag without the file extension now raises a Deprecation warning. In 2.0, it will no longer append .png to the file name. This is welcome change, unneeded magic is well...unneeded.
UPDATE: This change has been reverted for the time being. Now you can access the locals hash directly. In your partials, you can check if a local varialbe was passed in by doing: if locals[:local_var] then ...
In 2.0, the default for foreign_keys will be the association name, rather than the class name. So if you specify a :class_name with no :foreign_key on your belongs_to associations, it will throw a Deprecation warning. The tests explain this pretty well: