<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Drinkingbird: Rails and shitty SQL generation</title>
    <link>http://www.drinkingbird.net/blog/articles/2008/02/27/rails-and-shitty-sql-generation</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Random keyboard peckings</description>
    <item>
      <title>Rails and shitty SQL generation</title>
      <description>&lt;p&gt;Just a quick bitch about something I came across in setting up &lt;a href="http://www.redmine.org"&gt;Redmine&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Removing members from a project in the admin interface was silently failing for me.&lt;/p&gt;

&lt;p&gt;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&amp;#8217;s update_all method.&lt;/p&gt;

&lt;p&gt;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 &amp;#8220;ORDER BY&amp;#8221; 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.&lt;/p&gt;

&lt;p&gt;Really, what&amp;#8217;s the point of ordering your update statement?&lt;/p&gt;

&lt;p&gt;I don&amp;#8217;t know who to be more pissed off at over this, but given past experiences with mysql I&amp;#8217;ll pin it on them.&lt;/p&gt;

&lt;p&gt;FUCK YOU AGAIN, MYSQL!&lt;/p&gt;</description>
      <pubDate>Wed, 27 Feb 2008 20:57:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:5dca8a9e-ce67-4a53-8905-bfa1fb4cde02</guid>
      <author>Chris</author>
      <link>http://www.drinkingbird.net/blog/articles/2008/02/27/rails-and-shitty-sql-generation</link>
      <category>Ruby on Rails</category>
    </item>
    <item>
      <title>"Rails and shitty SQL generation" by Matt Wilson</title>
      <description>&lt;p&gt;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?&lt;/p&gt;

&lt;p&gt;I heart redmine though.&lt;/p&gt;</description>
      <pubDate>Thu, 22 May 2008 10:24:18 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:3d30e8f8-e0ef-4057-bc1d-79fb1ee66590</guid>
      <link>http://www.drinkingbird.net/blog/articles/2008/02/27/rails-and-shitty-sql-generation#comment-65</link>
    </item>
  </channel>
</rss>
