<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:ent="http://www.purl.org/NET/ENT/1.0/" version="2.0">
  <channel>
    <title>Curiouser and Curiouser! on rails</title>
    <link>http://matt.blogs.it/</link>
    <description>RSS feed for topic rails</description>
    <copyright>Copyright 2006 Matt Mower</copyright>
    <generator>Squib/0.4.0.348</generator>
    <managingEditor>self@mattmower.com</managingEditor>
    <webMaster>self@mattmower.com</webMaster>
    <language>en-gb</language>
    <item>
      <title>A squirt of grease is good for Rails</title>
      <link>http://matt.blogs.it/entries/00001936.html</link>
      <pubDate>Sat, 30 Jul 2005 12:03:22 +0100</pubDate>
      <description>&lt;p&gt;I've just installed &lt;a href="http://blog.monstuff.com/"&gt;Julien Couvreur's&lt;/a&gt; &lt;a href="http://blog.monstuff.com/archives/images/XMLHttpRequestDebugging.v1.0.user.js"&gt;XmlHttpRequestDebugging&lt;/a&gt; script for &lt;a href="http://greasemonkey.mozdev.org/"&gt;GreaseMonkey&lt;/a&gt;.  I've been using Safari since I &lt;a href="http://matt.blogs.it/2005/06/24.html#a1873"&gt;switched&lt;/a&gt; because it looks so much nicer than Firefox but as I starting trying to debug some Ajax stuff in a Rails app I'm working on I found myself reaching for FireFox and it's more capable developer tools.  Then, by chance, I remembered that someone had worked on an Ajax debugger and that lead me to Julien's script.&lt;/p&gt;
&lt;p&gt;What can I say?  Thank you Julien, great work .  This is a tip top tool.&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00001936.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>Sparklines relief</title>
      <link>http://matt.blogs.it/entries/00001943.html</link>
      <pubDate>Tue, 02 Aug 2005 15:09:03 +0100</pubDate>
      <description>&lt;p&gt;Any Tiger users who finds themselves wanting to use the &lt;a href="http://nubyonrails.topfunky.com/articles/2005/07/28/sparklines-graph-library-for-ruby"&gt;Sparklines&lt;/a&gt; library with Rails apps and gets into a miserable hell of RMagick and ImageMagick not playing well together go &lt;a href="http://poocs.net/articles/2005/07/06/making-rmagick-suck-less-with-tiger"&gt;get some relief&lt;/a&gt;!  [With a big note of thanks to lazy poster boy &lt;a href="http://outside-thoughts.octopod.info/"&gt;Octopod&lt;/a&gt;]&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00001943.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>4452 reasons to feel sad</title>
      <link>http://matt.blogs.it/entries/00002001.html</link>
      <pubDate>Sat, 24 Sep 2005 11:19:43 +0100</pubDate>
      <description>&lt;p&gt;&lt;a href="http://decafbad.com/blog/2005/09/23/the-zen-of-firehose-drinking#comments"&gt;l.m. has commented&lt;/a&gt; on my &lt;a href="http://matt.blogs.it/2005/09/19.html#a1992"&gt;recent statement&lt;/a&gt; that I am unable to keep up with the rubyonrails mailling list (I'm up to 4452 unread threads):&lt;blockquote&gt;The common thread Ive seen between both of theseand other bloggers expressing similar sentimentsis a vague sort of guilt over missing something&lt;/blockquote&gt;But it's actually not quite that.&lt;/p&gt;
&lt;p&gt;I don't feel guilty that I can't keep up.  What I actually feel is a sadness that I not only can't keep up with the leading edge of the Rails community, but that I can't keep up with the mainstream either.  That means I am less and less likely to be able to make a lasting contribution to that community and that makes me sad.&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002001.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>MacOSX on Rails</title>
      <link>http://matt.blogs.it/entries/00002005.html</link>
      <pubDate>Thu, 29 Sep 2005 15:04:14 +0100</pubDate>
      <description>&lt;p&gt;Any MacOSX users that want to give &lt;a href="http://www.rubyonrails.org/"&gt;RubyOnRails&lt;/a&gt; a try might want to check out Ryan Raaum's &lt;a href="http://weblog.rubyonrails.com/archives/2005/09/29/locomotive-0-2-4-easy-rails-for-os-x"&gt;Locomotive&lt;/a&gt; package.  It's kind of a 1-click deal for Rails that includes Ruby, Rails, useful libs, and the SQLLite database (it also includes MySQL and Postgresql bindings if you have those already).  I'm setup already but it looks kinda cool.&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002005.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>Get yer boards in Sync</title>
      <link>http://matt.blogs.it/entries/00002018.html</link>
      <pubDate>Tue, 04 Oct 2005 19:23:05 +0100</pubDate>
      <description>&lt;p&gt;&lt;a href="http://www.writeboard.com/"&gt;WriteBoard&lt;/a&gt; is the &lt;a href="http://37signals.com/svn/archives2/writeboard_is_live.php"&gt;latest app from 37signals&lt;/a&gt;.  It's a simple, single page, wiki facility.  You create a page and can then share it with other authors. Hrmm... okay.  They've just &lt;a href="http://37signals.com/svn/archives2/new_in_writeboard_document_locking.php"&gt;announced you can lock pages&lt;/a&gt; to prevent conflicts between author edits.  Hrmm... okay.  But how about &lt;a href="http://www.synchroedit.com/"&gt;implementing SynchroEdit&lt;/a&gt; instead?&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002018.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>Models Reloaded!</title>
      <link>http://matt.blogs.it/entries/00002019.html</link>
      <pubDate>Tue, 04 Oct 2005 21:55:28 +0100</pubDate>
      <description>&lt;p&gt;One of the neat things about Rails is that you can open what's called the &lt;em&gt;Developers Console&lt;/em&gt; (it's really &lt;tt&gt;irb&lt;/tt&gt;) and interact directly with your ActiveRecord models.  One nit is that, when you make changes, you need to exit and restart.  Well not any more, thanks to &lt;a href="http://habtm.com/articles/2005/10/04/script-console-reload-models"&gt;Courtnay for this trick&lt;/a&gt;:&lt;blockquote&gt;&lt;code&gt;&lt;pre&gt;
$ script/console
Loading development environment.
&gt;&gt; ..do stuff here..

then modify your model code..
then..

&gt;&gt; Dispatcher.reset_application!
models reloaded!
&lt;/pre&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002019.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>Instant Rails just add water!</title>
      <link>http://matt.blogs.it/entries/00002033.html</link>
      <pubDate>Wed, 12 Oct 2005 08:52:43 +0100</pubDate>
      <description>&lt;p&gt;Curt Hibbs (he of the excellent one-click Ruby installer for windows) has &lt;a href="http://blog.curthibbs.us/articles/2005/10/11/instant-rails-released-for-windows"&gt;issued a preview release&lt;/a&gt; of his new package &lt;a href="http://instantrails.rubyforge.org/wiki/wiki.pl"&gt;Instant Rails&lt;/a&gt;:&lt;blockquote&gt;Instant Rails is a one-stop Rails runtime solution containing Ruby, Rails, Apache, and MySQL, all preconfigured and ready to run. No installer, you simply drop it into the directory of your choice and run it. It does not modify your system environment. See the Release Notes for a complete list of what is included.&lt;/blockquote&gt;The preview is Windows only but releases for other operating systems will follow.&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002033.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>Normal service will be resumed (maybe)</title>
      <link>http://matt.blogs.it/entries/00002043.html</link>
      <pubDate>Thu, 20 Oct 2005 10:38:53 +0100</pubDate>
      <description>&lt;p&gt;Posting is a little infrequent right now because I'm having some issues with &lt;a href="http://radio.userland.com/"&gt;Radio Userland&lt;/a&gt;.  I've reached the crunch point: finally deciding whether to migrate to Mac and stick with Radio or replace it.  I've favoured the last option for a while but not found another package I wanted to migrate to.&lt;/p&gt;
&lt;p&gt;Yesterday I made a few baby steps on building a replacement by importing my database of about 2000 posts into MySQL and building a small Rails app around them.  Although I am somewhat loathe to build my own tool it would allow me to get what I want:&lt;ul&gt;&lt;li&gt;desktop solution&lt;/li&gt;&lt;li&gt;renders a static weblog site that can be uploaded to the site where &lt;a href="http://paolo.evectors.it/"&gt;Paolo&lt;/a&gt; kindly continues to host it for me&lt;/li&gt;&lt;li&gt;supports radio's permalink style&lt;/li&gt;&lt;li&gt;have things my way in terms of tags, rss feeds, and so on&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;
&lt;p&gt;I'm not persuaded but while experimenting with a new solution seems less unpleasant than doing the migration I'll probably hack at it until I am certain one way or another.&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002043.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>Life after Radio</title>
      <link>http://matt.blogs.it/entries/00002044.html</link>
      <pubDate>Fri, 21 Oct 2005 00:23:53 +0100</pubDate>
      <description>&lt;p&gt;After much wailing and gnashing of teeth I not only have my entire weblog archive in MySQL with all the entities playing nice (although much of the older HTML needs tidying up somewhat) but also have Rails rendering archive pages to disk which will honour the Radio permalinks.  This is actually a fair chunk of the work required for a no-frills weblog.&lt;/p&gt;
&lt;p&gt;I guess I may be looking at life after Radio after all...&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002044.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>Another little mile-stone</title>
      <link>http://matt.blogs.it/entries/00002047.html</link>
      <pubDate>Sat, 22 Oct 2005 01:25:25 +0100</pubDate>
      <description>&lt;p&gt;This evening I figured out how to do &lt;a href="http://matt.blogs.it/gems/test.txt"&gt;upstreaming to a Radio RCS server from Ruby&lt;/a&gt;.  The tricky bits were all the implicit details not covered by the &lt;em&gt;spec&lt;/em&gt;.  In the end I just threw Ethereal at the problem and watched Radio do it's thing.&lt;/p&gt;
&lt;p&gt;At this point I can fully render my weblog archives by day, month, year, or everything and I can now upstream to my blog space.&lt;/p&gt;
&lt;p&gt;Remaining tasks include:&lt;ul&gt;&lt;li&gt;a theme&lt;/li&gt;&lt;li&gt;an editing interface&lt;/li&gt;&lt;li&gt;implement tagging (&lt;a href="http://dema.ruby.com.br/articles/2005/08/27/easy-tagging-with-rails"&gt;acts_as_taggable&lt;/a&gt; to the rescue I expect)&lt;/li&gt;&lt;li&gt;implement a calendar&lt;/li&gt;&lt;/ul&gt;At that point I'll probably call it 1.0 and switch.&lt;/p&gt;
&lt;p&gt;At the moment it's designated codename: &lt;tt&gt;noradio&lt;/tt&gt;.&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002047.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>A small step on the way to 1.0</title>
      <link>http://matt.blogs.it/entries/00002051.html</link>
      <pubDate>Sat, 22 Oct 2005 23:59:19 +0100</pubDate>
      <description>&lt;p&gt;My (well mine, chris2, and DireRed's) &lt;a href="http://dev.rubyonrails.com/ticket/2562"&gt;second little contribution to Rails&lt;/a&gt; got accepted today.  Just one little patch among the many pouring into Rails to get it to the magic 1.0 mark.  It's quite an incredible effort and I'm happy just to have been some tiny part of it.&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002051.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>Here's why I haven't used Java in over a year</title>
      <link>http://matt.blogs.it/entries/00002052.html</link>
      <pubDate>Fri, 28 Oct 2005 12:41:15 +0100</pubDate>
      <description>&lt;p&gt;&lt;a href="http://jutopia.tirsen.com/articles/2005/10/28/why-ruby-on-rails"&gt;Why Ruby on Rails?&lt;/a&gt;.&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002052.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>ActiveRecord, Ruby 1.8.4, and GCC4</title>
      <link>http://matt.blogs.it/entries/00002098.html</link>
      <pubDate>Mon, 16 Jan 2006 11:53:45 +0000</pubDate>
      <description>&lt;p&gt;Yesterday was something of an exercise in frustration when I attempted to update my PowerBook to the latest and greatest Ruby 1.8.4. I use DarwinPorts so you'd think it would be easy but it's wasn't because (a) I didn't realise you had to manually use&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo port sync
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;to get the list of ports to update (so I didn't realise they even had 1.8.4) and (b) various ports wouldn't update properly or compile.&lt;/p&gt;

&lt;p&gt;In the end I ripped out my existing DarwinPorts installation, upgraded to the latest XCode 2.2, and began to rebuild. At the end I had 1.8.4 along with the relevant gems and extensions and it all seems fine.  Squib is running okay using it.&lt;/p&gt;

&lt;p&gt;However I notice that the ActiveRecord unit test suite is &lt;a href="http://rafb.net/paste/results/2P0lnM33.html"&gt;failing in some rather peculiar ways&lt;/a&gt;. Most of the errors relate to the non-existence of tables and rows which are there at the beginning of the test run (I verified that the executed DDL correctly created the tables). So it seems like something is dropping the tables and/or deleting rows as the tests execute. But if there was such a huge problem with Ruby/MySQL why is squib running okay?  (Yes I am backing up my data!)&lt;/p&gt;

&lt;p&gt;Where I do have cause for concern is the interplay between GCC v3.3 and GCC v4.0.1.  When I tried building Ruby 1.8.4 just after the release (to help with Rails testing) it didn't seem to work properly using GCC4. The wisdom at that time seemed to be that something in the GCC4 compiler wasn't right and was building ruby improperly. So naturally I used&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo gcc_select 3.3
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;before attempting to get the Ruby DarwinPort built. However when I came to testing the MySQL native extension I got a very unpleasant error:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;dyld: NSLinkModule() error
    dyld: Symbol not found: _sprintf$LDBLStub
    Referenced from: /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
    Expected in: flat namespace
    Trace/BPT trap&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The general wisdom seemed to be that this was an error caused by compiling with GCC4 but I was compiling with GCC3! In desparation I tried using GCC4 and it worked!&lt;/p&gt;

&lt;p&gt;But now I have Ruby compiled with GCC3 and various native bits and pieces with GCC4 and it does not make me happy or comfortable that everything will be okay. Especially in the light of the unit test failures in ActiveRecord.&lt;/p&gt;

&lt;p&gt;I'd be interested in hearing from anyone else whose tried these tests. Maybe there is something amiss with them.&lt;/p&gt;

&lt;p&gt;Overall I'm left with the feeling that Ruby 1.8.3 and 1.8.4 could have been smoother. And was it beyond Apple just to fix the Ruby install that came with Tiger in the first place?&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002098.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>It was an interesting experiment but I think it's over</title>
      <link>http://matt.blogs.it/entries/00002114.html</link>
      <pubDate>Wed, 18 Jan 2006 17:35:42 +0000</pubDate>
      <description>&lt;p&gt;I signed up for shared hosting with &lt;a href="http://textdrive.com/"&gt;TextDrive&lt;/a&gt; last year so I could start developing Rails applications. At the time they were a small company with big ideas and the service, although a little quirky, felt like doing business with friends -- there was a lot of excitement and energy in the air. At the time I remembered thinking that it would be very hard to scale this up and charge what they were charging ($12/mth). But you can hope.&lt;/p&gt;

&lt;p&gt;Over the last year there have been some problems. I think people on Gilford and Harwood have been suffering most recently but Barclay and Bidwell (my server) users were plagued with unreliability problems (and very tiresome 1hr+ restarts) lasy year. I guess things have improved somewhat since their move to a new datacentre but it's hardly been anything to make a song and dance about.&lt;/p&gt;

&lt;p&gt;At $12/mth I wasn't complaining particularly loudly. I didn't have live applications unable to serve customers. I hadn't recommended paying clients to use the service. It wasn't hosting my email or anything vital. In short, the interruptions to service were irritating and I would wish for better but I still felt I was getting, more or less, what I was paying for.&lt;/p&gt;

&lt;p&gt;Now I'm getting closer to releasing an application, developed with a friend in the U.S., and trying to test it and running into the &lt;a href="http://www.textdrive.com/aup"&gt;TextDrive AUP&lt;/a&gt; and a watchdog terminating my processes with prejudice -- no exceptions allowed. Let's just say these are not mammoth processes so I was quite non plussed.  I also wasn't terribly impressed that the terms the watchdog works under were not listed in the AUP (it is even more aggressive than what is defined there).&lt;/p&gt;

&lt;p&gt;So, TextDrive has been an interesting experiment but I just don't buy running applications on shared hosting at $12/mth. Apparently their business hosting packages have higher limits and less contention on the box. Frankly, at this point, the balance in my goodwill bank doesn't extend to giving them $60 for a month to find out.&lt;/p&gt;

&lt;p&gt;Instead I am going to look at using a &lt;a href="http://en.wikipedia.org/wiki/Vps"&gt;Virtual Private Server&lt;/a&gt;. You may still have contention issues, I'm concerned about the &lt;em&gt;real life&lt;/em&gt; performance you get, and it means having to administer the box yourself but I have realised, yet again, that I don't like giving up essential controls over my environment to other people. VPS seems to be a good compromise between shared hosting and the costs of a dedicated server.&lt;/p&gt;

&lt;p&gt;It seems the experiment may not so much be over as moving to a new phase.&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002114.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>Getting the full Rails stack installed on Debian</title>
      <link>http://matt.blogs.it/entries/00002122.html</link>
      <pubDate>Fri, 20 Jan 2006 15:06:31 +0000</pubDate>
      <description>&lt;p&gt;&lt;a href="http://brainspl.at/"&gt;Ezra Zygmuntowicz&lt;/a&gt; has worked out the details of &lt;a href="http://brainspl.at/rails_stack.html"&gt;getting the full Rails stack working on Debian&lt;/a&gt; and it's pretty smooth sailing. I went with Quantact not Rimu but that seems to make no difference (as you would expect). I also opted for Postgresql8.1 rather than MySQL, used RubyGems 0.8.11 instead of 0.8.10, and haven't decided yet whether I will install a mail server or not.&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002122.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>Rails 1.1 looks good</title>
      <link>http://matt.blogs.it/entries/00002151.html</link>
      <pubDate>Thu, 02 Mar 2006 18:26:25 +0000</pubDate>
      <description>&lt;p&gt;I don't really have the time these days to keep up with edge Rails so I'm very much looking forward to Rails 1.1 especially the &lt;a href="http://scottraymond.net/articles/2006/02/28/rails-1.1"&gt;new features in ActiveRecord for managing relationships and the RJS templates&lt;/a&gt;.  Like Curt Hibbs I think it &lt;a href="http://feeds.feedburner.com/curthibbs?m=150"&gt;sounds more like a 2.0 release&lt;/a&gt;.&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002151.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>Who else acts_as_taggable?</title>
      <link>http://matt.blogs.it/entries/00002176.html</link>
      <pubDate>Mon, 10 Apr 2006 11:44:43 +0100</pubDate>
      <description>&lt;p&gt;&lt;a href="http://squib.rubyforge.org/"&gt;Squib&lt;/a&gt; uses the &lt;a href="http://rubyforge.org/projects/taggable/"&gt;acts&lt;em&gt;as_taggable plugin&lt;/a&gt; for Rails to add tagging support. One of the big problems with implementing multiple weblog support in Squib was separating the topics because acts&lt;/em&gt;as_taggable doesn't do that. What it needs is scoping.&lt;/p&gt;

&lt;p&gt;I've had a couple of goes at mangling acts_as_taggable to do this but not quite got it right. I think what I need is a smarter coding partner who also wants this support and can work with me (maybe using Skype and SubEthaEdit) to implement it.&lt;/p&gt;

&lt;p&gt;Anyone else want to act_as_taggable?&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002176.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>All hail recipe 24!</title>
      <link>http://matt.blogs.it/entries/00002212.html</link>
      <pubDate>Thu, 11 May 2006 20:15:27 +0100</pubDate>
      <description>&lt;p&gt;I am of course talking about &lt;a href="http://www.pragmaticprogrammer.com/titles/fr_rr/"&gt;Rails Recipe&lt;/a&gt; No.24 "Adding Behaviour To Your ActiveRecord Associations". It's magical.&lt;/p&gt;

&lt;p&gt;In one of my applications there is a relationship from a &lt;code&gt;Feed&lt;/code&gt; to a &lt;code&gt;FeedExpression&lt;/code&gt; where the expression tracks the degree to which that feed associates with a concept (actually a &lt;a href="http://en.wikipedia.org/wiki/Value_theory"&gt;value&lt;/a&gt;). In Rails that's a pretty typical situation that you handle with &lt;code&gt;has_many&lt;/code&gt;, so:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class Feed &amp;lt; ActiveRecord::Base
    has_many :feed_expressions
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now I can refer to:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;feed.feed_expressions
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;to process the expressions.&lt;/p&gt;

&lt;p&gt;But I also use the concept of a &lt;code&gt;Slice&lt;/code&gt; which is allows for the division of the database into time periods like 'today', 'yesterday', 'last week', 'May 2005'. Each feed may actually have many different expressions for the same concept in different slices overlapping. But &lt;code&gt;feed_expressions&lt;/code&gt; acts like an Array which gives me a problem. I'm going to get the expressions from &lt;strong&gt;every&lt;/strong&gt; slice.&lt;/p&gt;

&lt;p&gt;In that case I'm going to have to manually filter out the expressions from just the slice I am interested in, e.g.:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;slice = Slice.find_by_name( 'this_week' )
feed.feed_expressions.select { |e| e.slice == slice }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That looks pretty ugly and things are only going to get worse when we realise how much overhead filtering all those unwanted slices is going to create on &lt;strong&gt;every&lt;/strong&gt; access.&lt;/p&gt;

&lt;p&gt;However &lt;em&gt;Recipe 24&lt;/em&gt; to the rescue... It turns out that &lt;code&gt;feed_expressions&lt;/code&gt; is not a real &lt;code&gt;Array&lt;/code&gt; but an &lt;code&gt;AssociationProxy&lt;/code&gt; masquerading as an Array. And Rails lets you add functionality to those proxies, so:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;module BySlices
    def for_slice( slice )
        find( :all, :conditions =&amp;gt; ['slice_id = ?', slice.id] )
    end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and a slight modification to &lt;code&gt;Feed&lt;/code&gt; along the lines of:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class Feed &amp;lt; ActiveRecord::Base
    has_many :feed_expressions, :extend =&amp;gt; BySlices
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;means that I can now use:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;feed.feed_expressions.for_slice( Slice.find_by_name( 'this_week' ) )
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;to get exactly the expressions I want and the filtering happens in SQL before ActiveRecord has to instantiate anything. Neat!&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002212.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>Capistrano makes managing applications a breeze</title>
      <link>http://matt.blogs.it/entries/00002214.html</link>
      <pubDate>Sat, 13 May 2006 10:56:57 +0100</pubDate>
      <description>&lt;p&gt;I'm using &lt;a href="http://manuals.rubyonrails.com/read/book/17"&gt;Capistrano&lt;/a&gt; to manage the configuration and deployment of a Rails based web application. Capistrano is good magic. At it's simplest what using Capistrano means is that after I check in a bunch of new changes to svn I go to the prompt and type:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cap -p &amp;lt;password&amp;gt; deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and Capistrano takes care of connecting to the Quantact VDS that is running the app, telling runit to shut down the application, checking out a new version of the repository code, making all the appropriate symbolic links to static things like config files and log directories, and then restarting the app so the new version is ready to serve.&lt;/p&gt;

&lt;p&gt;That alone would be pretty cool. But Capistrano has more magic to offer us that is based around &lt;em&gt;roles&lt;/em&gt;. Now I want to manage a separate aggregator process that is included in the codebase but not strictly part of the Rails application (they communicate using DRb).&lt;/p&gt;

&lt;p&gt;Turns out this was easy with a little reading of the &lt;a href="http://manuals.rubyonrails.com/read/chapter/102"&gt;docs covering extending tasks&lt;/a&gt;. The &lt;em&gt;deploy&lt;/em&gt; in the command line task given above refers to the &lt;em&gt;deploy task&lt;/em&gt; which manages the process I just described.&lt;/p&gt;

&lt;p&gt;This task can be extended using new tasks like &lt;em&gt;before_deploy&lt;/em&gt; and &lt;em&gt;after_deploy&lt;/em&gt; that do extra stuff. So in my case I've added a new &lt;em&gt;after_deploy&lt;/em&gt; task to handle restarting the aggregator process. What I've ended up with is this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;task :after_deploy do
    restart_agserver
end

desc "Restart aggregators"
task :restart_agserver, :role =&amp;gt; :aggregator do
    run "sv restart ~/service/agserver/"
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The indirection is necessary because you can only have one task with each name and I only want hosts with the &lt;code&gt;aggregator&lt;/code&gt; role to do this this particular task. So the &lt;code&gt;after_deploy&lt;/code&gt; task which may later be asked to do stuff for other roles, calls a more specific task which is restricted to the appropriate role.&lt;/p&gt;

&lt;p&gt;As you might expect, earlier in the recipe I declare this new role:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;role :aggregator, "www.metavalues.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This ability within the deployment recipe to create new roles, to extend tasks, and to restrict tasks to specific roles is, like Ruby itself, subtle and powerful. By making the deployment recipe a domain specific language for describing the maintenance of applications you get the whole package in way that is powerful (all of Ruby is at your commands) yet utterly simple.&lt;/p&gt;

&lt;p&gt;All in all I think Capistrano adds a huge amount to the value of Rails once you step beyond your text editor and think about what it means to run and maintain your application.&lt;/p&gt;

&lt;p&gt;Very neat.&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002214.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
    <item>
      <title>I know when I'm beaten</title>
      <link>http://matt.blogs.it/entries/00002215.html</link>
      <pubDate>Sat, 13 May 2006 11:20:49 +0100</pubDate>
      <description>&lt;p&gt;Okay so I got down to less than 10,000 unread threads in the Rails mailing list. I did this by going through page after page of threads in GMail hitting "Select All, Delete" until I got the number under 10,000. My strategy for the next 10,000 is &lt;em&gt;more of the same&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If Rails isn't mainstream now I don't want to see what that mailling list might look like when it is. Perhaps I will continue to miss many diamonds by not being there and I surely already hurt by not participating more but my day job isn't titled &lt;em&gt;developer&lt;/em&gt; and I just couldn't afford to keep up. Now I can't afford the cognitive pressure of even thinking about keeping up. It's never going to happen.&lt;/p&gt;

&lt;p&gt;Rails list, you have defeated me!&lt;/p&gt;</description>
      <guid isPermaLink="true">http://matt.blogs.it/entries/00002215.html</guid>
      <ent:cloud ent:href="http://matt.blogs.it/topics/">
      </ent:cloud>
    </item>
  </channel>
</rss>