News for hackers. Stuff that matters.
Re:Learning from Rails' failures by petercooper on Wednesday February 29, 2012 @05:40PM (#3650071)
In other words, they went from having a full method to having a param to a broader method and then BACK to having a full method.

You may know this but I wanted to note that this was not a "revert" as such in case less informed third parties thought this was capricious API design at its worst.

Today's #all is rather different to yesterday's #find_all in that the former supports chaining and is lazy evaluated, whereas the latter used to immediately hit the DB and required criteria to be included all in the one call.

Re:Learning from Rails' failures by mapgrep on Wednesday February 29, 2012 @05:45PM (#3650097)
Interesting. Do you know (honest question) why they didn't just make find(:all) work that way? In my imagined perfect world they'd have never got rid of find_all in the first place, and they'd have just added the lazy eval to it later. Or, failing that, done similar with find(:all).

Enjoy your podcast.

Re:Learning from Rails' failures by petercooper on Wednesday February 29, 2012 @05:51PM (#3650121)
As I'm not on the Rails core team and didn't really pay much attention to their design process, all I can offer is the major rewrite of ActiveRecord from 2 to 3 and, specifically, the introduction of Arel in AR3 had huge implications for the API design.

Specifically, check out the README at https://github.com/rails/arel .. if you're familiar with Rails 2 and earlier, the sorts of things you'll see there probably seem quite alien to you. I believe AR had to change a lot to fit in with this approach to SQL generation.

(And thanks!)