<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>alexjsharp.com - Home</title>
  <id>tag:alexjsharp.com,2008:mephisto/</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://alexjsharp.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://alexjsharp.com/" rel="alternate" type="text/html"/>
  <updated>2008-11-20T18:16:07Z</updated>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-11-20:586</id>
    <published>2008-11-20T18:13:00Z</published>
    <updated>2008-11-20T18:16:07Z</updated>
    <category term="git"/>
    <category term="rails"/>
    <link href="http://alexjsharp.com/2008/11/20/nevermind-that-last-article" rel="alternate" type="text/html"/>
    <title>Nevermind that last article</title>
<content type="html">
            &lt;p&gt;If you happened to read my post on managing plugins with git, pretend you didn&#8217;t because it doesn&#8217;t work as expected. I thought ignoring the .git directories in my clones plugin repositories would do the trick, but I was mistaken. My quest continues&#8230;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-11-18:582</id>
    <published>2008-11-18T18:27:00Z</published>
    <updated>2008-11-18T18:28:51Z</updated>
    <category term="ie6"/>
    <category term="random"/>
    <link href="http://alexjsharp.com/2008/11/18/ugh" rel="alternate" type="text/html"/>
    <title>Ugh...</title>
<content type="html">
            &lt;p&gt;From an email I just received from Google:&lt;/p&gt;


&lt;blockquote&gt;
New Gmail code base available to &lt;span class=&quot;caps&quot;&gt;IE6&lt;/span&gt; users:

Users of Internet Explorer 6 can now access significant Gmail performance improvements as well as new features like colored labels, group chat, an updated contact manager, remote sign out and more. To access these features, simply sign in to Gmail. If you don&#8217;t see these new features immediately, you may still need to get the latest &lt;span class=&quot;caps&quot;&gt;IE6&lt;/span&gt; updates from Microsoft.
&lt;/blockquote&gt;

	&lt;p&gt;Message to you poor souls still using this garbage browser: please stop. Ugh&#8230;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-11-15:577</id>
    <published>2008-11-15T06:33:00Z</published>
    <updated>2008-11-15T06:46:39Z</updated>
    <category term="economics"/>
    <link href="http://alexjsharp.com/2008/11/15/michael-milken-muhammad-yunus-on-charlie-rose" rel="alternate" type="text/html"/>
    <title>Michael Milken &amp; Muhammad Yunus on Charlie Rose</title>
<content type="html">
            &lt;p&gt;&lt;a href=&quot;http://www.charlierose.com/view/interview/9324&quot;&gt;http://www.charlierose.com/view/interview/9324&lt;/a&gt;. Really fantastic message in this interview, which is essentially that we ought to be encouraging entrepreneurship and self-employment as the means to achieve a higher standard of living and an improved quality of life (i.e. the American Dream).&lt;/p&gt;


	&lt;p&gt;Muhammad Yunus is an economist who won the Nobel Peace Prize a couple of years ago (2006, I believe) for his work in encouraging and pioneering micro-finance in third-world and developing countries. Now, with Michael Milken (famed inventor of the junk bond, now massive philanthropist), he is working to bring the concept of micro-finance to America. I am overjoyed to hear people advocating the message of entrepreneurship and independence. As layoffs continue to accelerate, the concept of financial independence being achieved through entrepreneurship could not be more important.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-10-30:575</id>
    <published>2008-10-30T20:58:00Z</published>
    <updated>2008-10-30T21:07:28Z</updated>
    <category term="quotes"/>
    <link href="http://alexjsharp.com/2008/10/30/try-to-be-punctual-in-all-your-dealings" rel="alternate" type="text/html"/>
    <title>Try to be punctual in all your dealings</title>
<content type="html">
            &lt;blockquote&gt;
&#8220;Try to be punctual in all your dealings. You will find it difficult to get along with some men, deal as little as possible with such&#8230;.Save your credit, for that is better than money&#8230;.If you go on in business, &lt;em&gt;be content with moderate gains&lt;/em&gt;. Don&#8217;t be too hasty to get too rich&#8230;.I was you to live so as to be fit to live and fit to die.&#8221; 
&lt;/blockquote&gt;
- from &lt;a href=&quot;http://www.amazon.com/gp/product/0553805096/ref=s9newr_c5_at2-rfc_p-3237_p?pf_rd_m=ATVPDKIKX0DER&amp;amp;#38;pf_rd_s=center-2&amp;amp;#38;pf_rd_r=1VWP18VKKAJ42HV2JJ6B&amp;amp;#38;pf_rd_t=101&amp;amp;#38;pf_rd_p=279438201&amp;amp;#38;pf_rd_i=507846&quot;&gt;The Snowball: Warren Buffett and the Business of Life&lt;/a&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-10-18:539</id>
    <published>2008-10-18T20:04:00Z</published>
    <updated>2008-10-18T20:05:41Z</updated>
    <category term="politics"/>
    <link href="http://alexjsharp.com/2008/10/18/unbelievable" rel="alternate" type="text/html"/>
    <title>Unbelievable</title>
<content type="html">
            From a &lt;a href=&quot;http://www.fivethirtyeight.com/2008/10/on-road-western-pennsylvania.html&quot;&gt;post&lt;/a&gt; over at &lt;a href=&quot;http://www.fivethirtyeight.com/2008/10/on-road-western-pennsylvania.html&quot;&gt;FiveThirtyEight&lt;/a&gt;:
&lt;blockquote&gt;
Over in Indiana, PA and Northern Cambria, PA, volunteers fielded complaints of a massive wave of ugly robocalls both paid for by John McCain's campaign and those paid for by third parties. The third party call was interactive, and purported to be from Barack Obama himself. The call starts out reasonably, and then &quot;Obama&quot; asks what the listener thinks is the most important issue. Whatever the response, &quot;Obama&quot; then launches into a profane and crazed tirade using &quot;n***er&quot; and other shock language.
&lt;/blockquote&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-10-15:506</id>
    <published>2008-10-15T16:28:00Z</published>
    <updated>2008-10-15T16:33:26Z</updated>
    <category term="rails"/>
    <category term="shoulda"/>
    <category term="testing"/>
    <link href="http://alexjsharp.com/2008/10/15/shoulda-painless-unit-testing" rel="alternate" type="text/html"/>
    <title>shoulda == 'painless unit testing'</title>
<content type="html">
            &lt;p&gt;I&#8217;m just getting started unit testing my models with &lt;a href=&quot;http://thoughtbot.com/projects/shoulda&quot;&gt;shoulda&lt;/a&gt; and so far it has been a wonderful experience. In large part, shoulda is no more than syntactic sugar for Test::Unit::TestCase. However, the crux of the philosophy behind shoulda is that it ought to be just as easy to test your ActiveRecord models as it is to write them. So, if it only requires one line of code in your model to build an ActiveRecord association, then it should only take one line of code to test that association. Such is the magic of shoulda.&lt;/p&gt;


Equally important is the simplicity of the core parts of the language. The shoulda source is extremely easy to read and follow. For example. the ActiveRecord macros are simply methods that wrap &lt;code&gt;should&lt;/code&gt; blocks, which are mixed in to &lt;code&gt;Test::Unit::TestCase&lt;/code&gt; as class methods.
&lt;pre&gt;
# taken from ThoughtBot::Shoulda::ActiveRecord::Macros
def should_require_attributes(*attributes)
  message = get_options!(attributes, :message)
  message ||= default_error_message(:blank)
  klass = model_class

  attributes.each do |attribute|
    should &quot;require #{attribute} to be set&quot; do
      assert_bad_value(klass, attribute, nil, message)
    end
  end
end
&lt;/pre&gt;

It wasn&#8217;t long before I found myself wanting a macro to test if a model contained a specific callback. It&#8217;s so easy to create your own macros it&#8217;s silly. Simply create a folder called &#8220;shoulda_macros&#8221; in &lt;span class=&quot;caps&quot;&gt;RAILS&lt;/span&gt;_ROOT/test/ and any files in that folder are automatically included. Here&#8217;s the macro I wrote:
&lt;pre&gt;
class Test::Unit::TestCase
  def self.should_have_callback(type, name)    
    klass = model_class
    should &quot;have #{type.to_sym} callback named #{name.to_sym}&quot; do
      assert_not_nil(klass.send(type.to_sym).detect { |callback| callback.kind == type.to_sym &#38;&#38; callback.method == name.to_sym }, &quot;#{type.to_sym} callback method #{name.to_sym} not found.&quot;)
    end
  end
end
&lt;/pre&gt;

	&lt;p&gt;In my opinion, shoulda is hands down the most painless way to test ActiveRecord models. Also, the fact that it is &lt;strong&gt;not&lt;/strong&gt; a drop-in replcement for Test::Unit, rather, it builds on top of it, is a major plus for me. Call me conservative, but there is a certain added feeling of safety and solidarity I have when my test framework is built &lt;em&gt;on top&lt;/em&gt; of the built-in Ruby testing package (Test::Unit), rather than replacing it outright, which is what &lt;a href=&quot;http://www.rspec.info&quot;&gt;rspec&lt;/a&gt; does. (I am still using rspec to test my controllers, and I&#8217;m looking forward to seeing what shoulda offers in this department)&lt;/p&gt;


	&lt;p&gt;For a great introduction and explanation of shoulda, checkout &lt;a href=&quot;http://mwrc2008.confreaks.com/12saleh.html&quot;&gt;Tammer Saleh&#8217;s presentation&lt;/a&gt; from MountainWest RubyConf 2008.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-10-04:445</id>
    <published>2008-10-04T19:20:00Z</published>
    <updated>2008-10-04T19:21:34Z</updated>
    <category term="leopard"/>
    <category term="os x"/>
    <link href="http://alexjsharp.com/2008/10/4/syslogd-cpu-usage-bug-in-leopard" rel="alternate" type="text/html"/>
    <title>syslogd cpu usage bug in leopard</title>
<content type="html">
            &lt;p&gt;My mac had been acting a little funky lately, so I popped open Activity Monitor to find that syslogd was taking up about 99.9% of my &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt;. Not good. I had noticed Little Snitch warning me lately of some outgoing messages to Apple&#8217;s crash report server, but I hadn&#8217;t thought much of it. Silly me.&lt;/p&gt;


	&lt;p&gt;I &lt;em&gt;think&lt;/em&gt; what was happening was that syslogd was trying to record something to my system&#8217;s asl database, and probably when I migrated to Leopard about a month ago, that file became corrupted. Thanks to &lt;a href=&quot;http://discussions.apple.com/thread.jspa?messageID=7403933&amp;amp;#38;&quot;&gt;this thread&lt;/a&gt; I seem to have fixed the problem. I&#8217;ll repeat the steps recommended in that thread.&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist &lt;/li&gt;
		&lt;li&gt;sudo mv /var/log/asl.db /var/log/asl.db.orig&lt;/li&gt;
		&lt;li&gt;sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist&lt;/li&gt;
		&lt;li&gt;Restart (probably not necessary, but let&#8217;s do it just to be safe)&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;Now no more cpu-eating syslogd madness. Too bad I just bought more ram.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-07-29:19</id>
    <published>2008-07-29T04:19:00Z</published>
    <updated>2008-07-29T04:20:36Z</updated>
    <category term="git"/>
    <category term="tutorials"/>
    <category term="ubuntu"/>
    <link href="http://alexjsharp.com/2008/7/29/git-problems-on-ubuntu-gutsy" rel="alternate" type="text/html"/>
    <title>Git problems on Ubuntu Gutsy</title>
<content type="html">
            &lt;p&gt;This may seem like a bit of an edge case, but if you&#8217;re using a setup similar to mine, it is very relevant. Here&#8217;s the long and short of it: if you&#8217;re hosting private &lt;a href=&quot;http://git.or.cz&quot;&gt;git&lt;/a&gt; repositories on a server that only allows access to a non-standard ssh port (i.e. not port 22), then you must build git from source. The reason for this is that the version of git in the Ubuntu Gutsy package manager is 1.5.2 (as of this writing), and that version does not support specifying port numbers in your remote urls. Pooey.&lt;/p&gt;


	&lt;p&gt;So, we have to build git from source. I highly recommend following &lt;a href=&quot;http://chrisolsen.org/2008/03/10/installing-git-on-ubuntu/&quot;&gt;this tutorial&lt;/a&gt;. That post doesn&#8217;t cover installing the git documentation, so I&#8217;ll hit on that real quick. Follow &lt;a href=&quot;http://chrisolsen.org/2008/03/10/installing-git-on-ubuntu/&quot;&gt;Chris&#8217; post&lt;/a&gt; until you get to the last section, where you compile and install git.&lt;/p&gt;


To install the man pages, you need to install a monstrosity of a package (somewhere around 700mb after installed) called &lt;code&gt;asciidoc&lt;/code&gt;. &lt;strong&gt;Note: this will take &lt;span class=&quot;caps&quot;&gt;A WHILE&lt;/span&gt;.&lt;/strong&gt; (If anyone knows how to do this without downloading a 700mb package, please let me know and I&#8217;ll update this post.)
&lt;pre&gt;
sudo aptitude install asciidoc 
&lt;/pre&gt;

Now, download and unpack the latest stable version of git, and substitute these last two steps for the one&#8217;s Chris has:
&lt;pre&gt;
make MOZILLA_SHA1=1 prefix=/usr all doc
sudo make MOZILLA_SHA1=1 prefix=/usr install install-doc
&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-07-04:18</id>
    <published>2008-07-04T19:08:00Z</published>
    <updated>2008-09-18T17:31:19Z</updated>
    <category term="random"/>
    <link href="http://alexjsharp.com/2008/7/4/i-almost-forgot" rel="alternate" type="text/html"/>
    <title>I almost forgot</title>
<content type="html">
            &lt;p&gt;It&#8217;s July 4th, and I&#8217;ve been posting about &lt;a href=&quot;http://alexjsharp.com/2008/7/4/displaying-inline-list-items&quot;&gt;css&lt;/a&gt; and &lt;a href=&quot;http://alexjsharp.com/2008/7/4/best-job-posting-ever&quot;&gt;cool job postings&lt;/a&gt;. How selfish of me.&lt;/p&gt;


	&lt;p&gt;Happy birthday America!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-07-04:17</id>
    <published>2008-07-04T19:06:00Z</published>
    <updated>2008-11-10T17:58:28Z</updated>
    <category term="css"/>
    <link href="http://alexjsharp.com/2008/7/4/displaying-inline-list-items" rel="alternate" type="text/html"/>
    <title>Displaying inline list items</title>
<content type="html">
            &lt;p&gt;I am not a css designer. I hate the language, I hate the implementation, I hate the inconsistency of browser support. This is no fault of css or the good people who have pioneered and built the language. Rather, it is more the nature of a client-side technology. Javascript has suffered many of the same problems, but cross-browser support has gotten noticeably better in recent years.&lt;/p&gt;


	&lt;p&gt;Unfortunately, css is probably the one web technology (other than &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt;) that is nearly impossible not to use. For the most part, my deep hatred of css programming is due to the &#8220;hackish&#8221; nature the language has been forced to adopt, almost exclusively because of Microsoft Internet Explorer 5.5 and 6, the massive number of bugs these browsers have, and Microsoft&#8217;s failure to patch these browsers. That said, let&#8217;s get on with it.&lt;/p&gt;


	&lt;p&gt;Often I need to display a series of items on the same line. Whenever possible, I try not to use floats because of the plethora of bugs in earlier versions of IE. My first attempt is often to use &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt;&#8217;s, set &lt;code&gt;list-style: none;&lt;/code&gt; and &lt;code&gt;display: inline;&lt;/code&gt;. However, due to the nature of how a &lt;code&gt;display: inline;&lt;/code&gt; element is meant to be displayed, this approach is simply not useful for any type of content beyond a menu/nav bar. So, we are forced to float the list items. I don&#8217;t know about you, but I feel defeated.&lt;/p&gt;


First, here&#8217;s a sample of what kind of data we need to display:
&lt;pre&gt;
&amp;lt;ul id=&quot;products&quot;&amp;gt;
  &amp;lt;li&amp;gt;
    &amp;lt;div class=&quot;prod_img&quot;&amp;gt;&amp;lt;img src=&quot;path/to/image&quot; alt=&quot;blah&quot; /&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&quot;description&quot;&amp;gt;
      &amp;lt;strong&amp;gt;Here's a little description.&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;
      &amp;lt;span&amp;gt;Here's some more.&amp;lt;/span&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;...&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/pre&gt;

And here&#8217;s the style rules that &lt;strong&gt;should&lt;/strong&gt; satisfy our needs:
&lt;pre&gt;
ul#products {
  list-style: none; 
  overflow: auto;
  border: 1px solid black; /* border added to illustrate forthcoming IE display bug */
}
ul#products li {
  list-style: none;
  float: left;
}
&lt;/pre&gt;

	&lt;p&gt;We have the &lt;code&gt;overflow: auto;&lt;/code&gt; declaration so that the containing ul &#8220;hasLayout&#8221;. We have to to do this when a containing element contains all floats, or elements that don&#8217;t flow in the normal course of the document. As expected, &lt;span class=&quot;caps&quot;&gt;IE 6&lt;/span&gt; screws this up. We have to add a seemingly ambiguous &lt;code&gt;height&lt;/code&gt; property declaration:&lt;/p&gt;


&lt;pre&gt;
ul#products {
  height: 100%;
}
&lt;/pre&gt;

	&lt;p&gt;There, now we&#8217;ve got it. Inline list items that can contain block-level items, while remaining on the same line.&lt;/p&gt;


	&lt;h2&gt;A short rant&lt;/h2&gt;


	&lt;p&gt;Maybe this a bit whiny/preachy, but having to resort to this kind of thing royally pisses me off. It&#8217;s not that it&#8217;s a lot to type, or that I had to implement some css hack that only IE version x will recognize. No, it&#8217;s simply that I had to make a special exception just for older versions of IE, while everything else works &lt;strong&gt;the way it&#8217;s supposed to work&lt;/strong&gt;.&lt;/p&gt;


	&lt;p&gt;That, in a nutshell, is why I enjoy server-side programming, and why I for the most part deplore client-side programming. With server-side technologies, you know your boundaries. You are confined to the limits of your server operating system software, and the limits of the language in which you&#8217;re working. If you work within those limits, generally speaking, &lt;strong&gt;things will work the way they are supposed to work&lt;/strong&gt;.&lt;/p&gt;


	&lt;p&gt;With client-side technologies, namely &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt;, you end up spending just as much time learning and implementing the bugs, workarounds, and compatibility issues that you do actually writing code! This problem is not exclusive to Microsoft, albeit they are a big part of it. A &lt;a href=&quot;http://www.quirksmode.org/css/display.html&quot;&gt;perfect example&lt;/a&gt; is cross-browser compatibility for the various css display modes. All of those &lt;code&gt;display&lt;/code&gt; properties have been part of &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; since &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; version 2 was released. Are you ready for a laugh? &lt;a href=&quot;http://www.w3.org/TR/REC-CSS2/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;CSS2&lt;/span&gt;&lt;/a&gt; was released in &lt;strong&gt;May 1998, now more than 10 years ago!&lt;/strong&gt; Seriously!? Ten years, and we still can&#8217;t get cross browser support for &lt;code&gt;inline-block&lt;/code&gt;. Rant over.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-07-04:16</id>
    <published>2008-07-04T15:36:00Z</published>
    <updated>2008-10-20T02:32:55Z</updated>
    <category term="random"/>
    <link href="http://alexjsharp.com/2008/7/4/best-job-posting-ever" rel="alternate" type="text/html"/>
    <title>Best job posting ever</title>
<content type="html">
            &lt;p&gt;&lt;a href=&quot;http://jobs.37signals.com/jobs/3861&quot;&gt;Check this out&lt;/a&gt;. What a great way to advertise a position.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-07-03:14</id>
    <published>2008-07-03T18:18:00Z</published>
    <updated>2008-11-10T17:58:16Z</updated>
    <category term="firefox"/>
    <link href="http://alexjsharp.com/2008/7/3/firefox-3-text-resizing-quirk" rel="alternate" type="text/html"/>
    <title>Firefox 3 text resizing quirk</title>
<content type="html">
            &lt;p&gt;If you, like me, are the type who occasionally likes to resize your text while reading a web page, you may be unhappy with how Firefox 3 handles this. In Firefox 2, and all other browsers (to my knowledge), the browser simply resizes the text on the page. In Firefox 3, images and everything are resized/re-rendered. I don't like this; all I want is my text resized, not a bunch of blurry images while I'm trying to ready. Eh.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-07-02:13</id>
    <published>2008-07-02T23:30:00Z</published>
    <updated>2008-07-02T23:32:03Z</updated>
    <category term="plugins"/>
    <category term="rails"/>
    <link href="http://alexjsharp.com/2008/7/2/mass-assignment-murderer" rel="alternate" type="text/html"/>
    <title>My first plugin: mass_assignment_murderer</title>
<content type="html">
            &lt;p&gt;I recently published my first public plugin called &lt;a href=&quot;http://github.com/ajsharp/mass_assignment_murderer/tree/master&quot;&gt;mass_assignment_murderer&lt;/a&gt;. You can get it &lt;a href=&quot;http://github.com/ajsharp/mass_assignment_murderer/tree/master&quot;&gt;here&lt;/a&gt; from github. Currently, a subversion release is not planned. Basically, the plugin addresses the mass assignment problem covered in &lt;a href=&quot;http://railscasts.com/episodes/26&quot;&gt;Railscast Episode 26&lt;/a&gt;.&lt;/p&gt;


&lt;code&gt;mass_assignment_murderer&lt;/code&gt; provides an ActiveRecord class method cleverly titled, &lt;code&gt;has_mass_assignment_murderer&lt;/code&gt;, which protects your models from mass assignment through a has_many or many-to-many association. Specifically, it looks for an methods that end with &#8220;_ids&#8221; and then calls &lt;code&gt;attr_protected&lt;/code&gt; on those methods. 

	&lt;p&gt;For a future version, I&#8217;m thinking of simply auto-protecting all such methods in all models, without having to make any sort of declaration.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-06-28:10</id>
    <published>2008-06-28T04:06:00Z</published>
    <updated>2008-06-28T04:06:28Z</updated>
    <category term="gems"/>
    <category term="rails"/>
    <link href="http://alexjsharp.com/2008/6/28/freezing-a-specific-version-of-the-rails-gem" rel="alternate" type="text/html"/>
    <title>Freezing a specific version of the rails gem</title>
<content type="html">
            Thanks to Radar on the #rubyonrails irc channel for showing me the way with this one. Basically, I updated my rails gem to rails 2.1, and I had not frozen rails in all of my projects. This broke my mephisto project for this site on my development machine, so I wanted to freeze rails version 2.0.2 to this project. Here&#8217;s how it&#8217;s done:
&lt;pre&gt;
rake rails:freeze:gems VERSION=2.0.2
&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://alexjsharp.com/">
    <author>
      <name>alex</name>
    </author>
    <id>tag:alexjsharp.com,2008-06-24:8</id>
    <published>2008-06-24T00:15:00Z</published>
    <updated>2008-06-28T03:28:41Z</updated>
    <category term="rubygems"/>
    <category term="slicehost"/>
    <link href="http://alexjsharp.com/2008/6/24/manually-upgrading-to-rubygems-1-2" rel="alternate" type="text/html"/>
    <title>Manually Upgrading to Rubygems 1.2</title>
<content type="html">
            If you didn&#8217;t have the pleasure of experiencing the &lt;a href=&quot;http://forum.slicehost.com/comments.php?DiscussionID=1656&quot;&gt;awesome memory leak&lt;/a&gt; rubygems 1.1 caused, consider yourself lucky. If you are on a modestly sized &lt;span class=&quot;caps&quot;&gt;VPS&lt;/span&gt;, such as a &lt;a href=&quot;http://www.slicehost.com/&quot;&gt;slicehost 256 mb slice&lt;/a&gt;, I do not recommend running &lt;code&gt;gem update --system&lt;/code&gt; to upgrade rubygems. It is almost sure to slow your server to a screeching halt. Here&#8217;s how you install it manually:
&lt;pre&gt;
mkdir ~/sources
cd ~/sources
wget http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz # you could use curl instead of wget, it just depends what is installed on your system
tar -zxvf rubygems-1.2.0.tgz
cd rubygems-1.2.0
sudo ruby setup.rb
&lt;/pre&gt;

	&lt;p&gt;And you&#8217;re good to go! No more memory leak.&lt;/p&gt;
          </content>  </entry>
</feed>
