Rails and shitty SQL generation

Posted by Chris Thu, 28 Feb 2008 02:57:00 GMT

Just a quick bitch about something I came across in setting up Redmine.

Removing members from a project in the admin interface was silently failing for me.

It turns out that Redmine, rather sensibly, updates the project so that no issues are automatically assigned to the user being removed from the project. This makes a call to ActiveRecord::Base’s update_all method.

This was the call that was failing, and it was all down to the fact that ActiveRecord was passing my postgres database an update query with an “ORDER BY” clause, which is apparently the sort of fucking retarded feature that mysql decided to implement, and which some useless dick chose to support in AR.

Really, what’s the point of ordering your update statement?

I don’t know who to be more pissed off at over this, but given past experiences with mysql I’ll pin it on them.

FUCK YOU AGAIN, MYSQL!

Posted in  | 1 comment

Comments

  1. Matt Wilson said 3 months later:

    Yeah, AR can do some really gnarly stuff. You ever get frustrated when it makes 40 separate queries instead of a single query with a join?

    I heart redmine though.

Comments are disabled