The If Works / This dirt was a building before The If Works Feed
  • ARCHIVE / IncludeByDefault
  • How to fix bugs in software the hard way, or, why open source software is so damn helpful

    If nothing else, this week has taught me a few things about bug fixing. As I’ve written about before, my IncludeByDefault plugin (or, more accurately, the project I’m using it for) exposed a bug or two in Rails. Revision 17 is the result of a very messy process trying to chase a bug up and [...]

    Posted on Jul 13.07 to IncludeByDefault, Rails, Ruby   Add a Comment   

  • IncludeByDefault progress

    IncludeByDefault, as mentioned in my last post, hit some snags with ActiveRecord generating duplicate table aliases when doing cascaded includes, e.g.
    Tag.find(8).posts.find(:all, :include => :tags)
    So, I set out to work around it, only to run into further problems. I went with option C: let find operations get all the way to the database, and then catch [...]

    Posted on Jul 11.07 to IncludeByDefault, Rails, Ruby   Add a Comment   

  • Including in circles

    Not long had I been using my new plugin when I discovered it made this happen when trying to eager-load on a many-to-many association:
    SELECT DISTINCT news_stories.id
    FROM news_stories
    LEFT OUTER JOIN countries_news_stories
    ON countries_news_stories.news_id = news_stories.id
    LEFT OUTER JOIN countries
    ON countries.id = countries_news_stories.country_id
    INNER JOIN countries_news_stories
    ON news_stories.id = [...]

    Posted on Jul 09.07 to IncludeByDefault, Rails, Ruby   1 Comment   

  • New Rails plugin: IncludeByDefault

    It’s true, I’m a plugin writing machine. Seriously though, this one’s tiny. I took all of five minutes to write. What it does is, it lets you specify a default value for the :include option on ActiveRecord::Base.find, so you can automate eager loading of associations. I’ll use an example I’m comfortable with:
    class BlogEntry [...]

    Posted on Jul 09.07 to IncludeByDefault, Rails, Ruby   Add a Comment   

INSIDE    ←


The If Works


FUN / PAGES

  • AttrLocked
  • Flagger
  • Grape
  • Holly
  • IncludeByDefault
  • JS.Class
  • LabelHelper
  • PackR
  • Reiterate
  • Sylvester

    FIND / SEARCH


FEEDS / RSS

  • Entries
  • Comments

FOOTER / LEST WE FORGET
Copyright © 2007–2008 by The If Works, unless otherwise noted. All rights reserved. Powered by WordPress. Modio theme by Upstart Blogger.