<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.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>ActsAsFlinn : </title>
    <link>http://actsasflinn.com/.rss</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>$ ./script/plugin install acts_as_flinn</description>
    <item>
      <title>5 Reasons DataMapper Will Deprecate ActiveRecord</title>
      <description>&lt;p&gt;Merb brought much attention to the ActiveRecord alternative &lt;span class="caps"&gt;ORM&lt;/span&gt; DataMapper and I feel like it&amp;#8217;s going to put a serious hurting on ActiveRecord.  My reasoning is based on the fact that alternate data storage technologies are gaining serious traction.  The latest and greatest (&lt;a href="http://couchdb.apache.org/"&gt;couchdb&lt;/a&gt;, &lt;a href="http://github.com/cliffmoon/dynomite/tree"&gt;dynomite&lt;/a&gt;, &lt;a href="http://code.google.com/p/the-cassandra-project/"&gt;cassandra&lt;/a&gt;, &lt;a href="http://code.google.com/p/thrudb/"&gt;thrudb&lt;/a&gt;) are offering distributed document / object databases that will make creating highly scalable websites even easier and faster, oh yeah and they&amp;#8217;re all free.  With that in mind, I&amp;#8217;m expecting a paradigm shift in data stores (big variable huh?).  At the very least I expect &lt;a href="http://ruby.gemstone.com/"&gt;Maglev&lt;/a&gt; to come true and the free/open source clones to follow.  The model storage shift then becomes, how to you write the validations, callbacks, plugins and relationships for first class Ruby objects&amp;#8230; DataMapper basically has all the pieces there already.  With that in mind here are 5 reasons DataMapper will rule Ruby object data storage.&lt;/p&gt;


	&lt;h3&gt;#1 Rails 3&lt;/h3&gt;


	&lt;p&gt;(this is the big one) Rails 3 (Merb) will open Rails up to &lt;span class="caps"&gt;ORM&lt;/span&gt; alternatives like DataMapper.  This will fuel uptake of DataMapper and others.&lt;/p&gt;


	&lt;h3&gt;#2 property&lt;/h3&gt;


	&lt;p&gt;This is a core difference in how DataMapper and ActiveRecord work.  DataMapper allows the developer to define the property (attribute/column) in the class.  Defining your attributes is better than letting the data store define it.  This will become more apparent with the adoption of document/object databases that don&amp;#8217;t define a hard schema.&lt;/p&gt;


	&lt;h3&gt;#3 It&amp;#8217;s Ruby&lt;/h3&gt;


	&lt;p&gt;Defining properties in terms of real Ruby classes is the hotness.  Take any ruby class then, include DataMapper::Resource&amp;#8230; done.&lt;/p&gt;


	&lt;h3&gt;#4 Laziness + Strategic Eager Loading&lt;/h3&gt;


	&lt;p&gt;Yeah, one of DataMapper&amp;#8217;s core features is it&amp;#8217;s ability to iterate over associations without causing the n + 1 query problem.  Whether dealing with &lt;span class="caps"&gt;SQL&lt;/span&gt; or Memcache or something new this will always be an issue.  It&amp;#8217;s 1 vs. many selects, io, or network hits it will never not be an issue.  DataMapper handles this gracefully.&lt;/p&gt;


	&lt;h3&gt;#5 Mapping Data vs. Record Handling&lt;/h3&gt;


	&lt;p&gt;ActiveRecord is based on the assumption your storage is a database record.  The entire library is written with that in mind.  DataMapper is extensible and modular.  Don&amp;#8217;t need &lt;span class="caps"&gt;SQL&lt;/span&gt;?  OK great, but you still need validations, properties, callbacks, and relationships.  DataMapper has this covered whether it&amp;#8217;s &lt;span class="caps"&gt;SQL&lt;/span&gt;, REST, CouchDB, or anything else.  It&amp;#8217;s easy to create something new.&lt;/p&gt;</description>
      <pubDate>Fri, 02 Jan 2009 05:24:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:be08ac34-0c8e-4fa1-b11d-0d380892d238</guid>
      <comments>http://www.actsasflinn.com/2009/01/02/5-reasons-datamapper-will-deprecate-activerecord#comments</comments>
      <category>ruby</category>
      <category>rails</category>
      <category>merb</category>
      <category>datamapper</category>
      <category>activerecord</category>
      <category>couchdb</category>
      <category>dynomite</category>
      <trackback:ping>http://www.actsasflinn.com/trackbacks?article_id=5-reasons-datamapper-will-deprecate-activerecord&amp;day=02&amp;month=01&amp;year=2009</trackback:ping>
      <link>http://www.actsasflinn.com/2009/01/02/5-reasons-datamapper-will-deprecate-activerecord</link>
    </item>
    <item>
      <title>Federated Login with OpenID</title>
      <description>&lt;img src="http://www.actsasflinn.com/files/openid-logo.png" style="margin:10px;float:right" alt="OpenID Logo" /&gt;
	&lt;h3&gt;OpenID as a Single Sign-On&lt;/h3&gt;


	&lt;p&gt;I&amp;#8217;m working on implementing &lt;span class="caps"&gt;SAML&lt;/span&gt; relying party services for a large household brand.  I recommended OpenID about a year ago but they chose &lt;span class="caps"&gt;SAML&lt;/span&gt; instead.  &lt;span class="caps"&gt;SAML&lt;/span&gt; is &lt;s&gt;Sun&amp;#8217;s&lt;/s&gt; an industry standard for Single Sing-On.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve come to realize why the powers that be chose &lt;span class="caps"&gt;SAML&lt;/span&gt; instead of OpenID.  OpenID is essentially the same thing as &lt;span class="caps"&gt;SAML&lt;/span&gt; but &lt;span class="caps"&gt;SAML&lt;/span&gt;&amp;#8217;s user experience is designed in such a way that the &lt;span class="caps"&gt;IDP&lt;/span&gt; is providing a federated sign-on process.  The user experience is designed for sign-in not &lt;strong&gt;cover-your-ass disclaimers&lt;/strong&gt; like you find with most OpenID providers.&lt;/p&gt;


	&lt;p&gt;For example, a user browsing a &lt;span class="caps"&gt;CNN&lt;/span&gt; partner site can expect a &lt;span class="caps"&gt;CNN&lt;/span&gt; login page and &lt;span class="caps"&gt;CNN&lt;/span&gt;&amp;#8217;s login page doesn&amp;#8217;t educate the user on the virtues of &lt;span class="caps"&gt;SAML&lt;/span&gt;.  The OpenID user experience can be implemented the exact same way but they chose &lt;span class="caps"&gt;SAML&lt;/span&gt; because when they tried someone&amp;#8217;s (Yahoo!) OpenID implementation they were confused (for good reason).  In their mind OpenID was a bad user experience.  They took it at face value and didn&amp;#8217;t know that you could engineer the OpenID user experience.&lt;/p&gt;


	&lt;h3&gt;Guess what.  OpenID can be used for Single Sign-On.&lt;/h3&gt;


	&lt;p&gt;OpenID can be used for federated login.  Here&amp;#8217;s how.&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;On your consumer sites take a username and figure out the identity url for the user (don&amp;#8217;t ask for it)&lt;/li&gt;
		&lt;li&gt;Setup a regular login page on your OpenID provider&lt;/li&gt;
		&lt;li&gt;Setup the appropriate release policy for your consumer sites&lt;/li&gt;
		&lt;li&gt;By default turn on a remember me cookie at the &lt;span class="caps"&gt;IDP&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;Use cookies on your consumer sites to figure out the identity url for the user.&lt;/li&gt;
	&lt;/ol&gt;


	&lt;h3&gt;Single Sign-On with OpenID = Done.&lt;/h3&gt;


	&lt;p&gt;The result is a user that has no idea they&amp;#8217;ve just used OpenID (a great user experience), a provider that can service any partners and partners that can integrate faster with a well supported open stack available for many platforms right now.&lt;/p&gt;</description>
      <pubDate>Sun, 07 Dec 2008 15:16:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ec3a9eec-510f-4727-b1f2-dcd3cf43f4b8</guid>
      <comments>http://www.actsasflinn.com/2008/12/07/federated-login-with-openid#comments</comments>
      <category>openid</category>
      <category>saml</category>
      <trackback:ping>http://www.actsasflinn.com/trackbacks?article_id=federated-login-with-openid&amp;day=07&amp;month=12&amp;year=2008</trackback:ping>
      <link>http://www.actsasflinn.com/2008/12/07/federated-login-with-openid</link>
    </item>
    <item>
      <title>OpenID is missing the boat</title>
      <description>&lt;h3&gt;OpenID User Experience is Piss Poor&lt;/h3&gt;


	&lt;p&gt;With piss poor OpenID setups providers are missing the opportunity to leverage their #1 asset, their user base.  Recent OpenID user experience research from &lt;a href="http://developer.yahoo.net/blog/archives/2008/10/open_id_research.html"&gt;Yahoo&lt;/a&gt; and &lt;a href="http://sites.google.com/site/oauthgoog/UXFedLogin/CombineGoogYahoo"&gt;Google&lt;/a&gt; show something obvious &amp;#8211; they both suck at providing OpenID.  OpenID in its most basic form allows the user to supply a &lt;span class="caps"&gt;URL&lt;/span&gt;.  Even if that&amp;#8217;s the best UX you can come up with, don&amp;#8217;t give the user a hash they can&amp;#8217;t remember (Yahoo!).  But that&amp;#8217;s not the best you can do.  There is no standard that says the user has to supply their own &lt;span class="caps"&gt;URL&lt;/span&gt;, you &lt;s&gt;can&lt;/s&gt; should build it for them.  Also, I don&amp;#8217;t care what anyone says about fracturing the standard, &lt;span class="caps"&gt;GOOG&lt;/span&gt; is right &amp;#8211; email is the obvious choice.&lt;/p&gt;


	&lt;p&gt;Facebook Connect is getting crazy adoption because it&amp;#8217;s easy and the user doesn&amp;#8217;t have to make a choice about what &lt;span class="caps"&gt;IDP&lt;/span&gt; to use.  &lt;span class="caps"&gt;FBC&lt;/span&gt; is going to continue to mop up because they have a huge user base that is arguably more savvy than other large &lt;span class="caps"&gt;IDP&lt;/span&gt;&amp;#8217;s.  Facebook is making it easy to just get to what you want without caring about login.&lt;/p&gt;


	&lt;p&gt;Implementing OpenID shouldn&amp;#8217;t be completely promiscuous.  Choose a partner and be happy with your choice.  What I mean by that is, if you think Yahoo!, &lt;span class="caps"&gt;AOL&lt;/span&gt;, Google are going to provide you with the right registered user base just pick one.  Present only one or two &lt;span class="caps"&gt;IDP&lt;/span&gt; options and maybe an advanced option for power users if you really want it.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re consuming OpenID and not making it simple for users you&amp;#8217;re missing the boat.  If you&amp;#8217;re providing OpenID and trying to educate the user or filling your page with warning triangles and disclaimers your putting holes in your ship.&lt;/p&gt;</description>
      <pubDate>Sun, 07 Dec 2008 06:12:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:0698ba07-94fa-4292-a922-3786bbf4d37b</guid>
      <comments>http://www.actsasflinn.com/2008/12/07/openid-is-missing-the-boat#comments</comments>
      <category>openid</category>
      <trackback:ping>http://www.actsasflinn.com/trackbacks?article_id=openid-is-missing-the-boat&amp;day=07&amp;month=12&amp;year=2008</trackback:ping>
      <link>http://www.actsasflinn.com/2008/12/07/openid-is-missing-the-boat</link>
    </item>
    <item>
      <title>Engine Yard As A Service</title>
      <description>&lt;div style="float:right;margin:10px;"&gt;&lt;a href="http://www.flickr.com/photos/mattpicio/2825488057/"&gt;&lt;img src="http://actsasflinn.com/files/no-hands.png" alt="no hands" /&gt;&lt;/a&gt;&lt;br /&gt;No Hands Rails Stack&lt;/div&gt;

	&lt;p&gt;Ezra just announced a new service coming in January.  They&amp;#8217;re extracting the Engine Yard stack into an easily configurable service for booting up new Engine Yard nodes.  The service is promising, even supports building nodes based on &lt;span class="caps"&gt;JSON&lt;/span&gt;.  I&amp;#8217;d expect this type of setup to replace &lt;span class="caps"&gt;AWS&lt;/span&gt; as a rails stack based on all the work Engine Yard has done on the deployment process and operations of a rails stack.  The screens shown looked highly configurable, check boxes with memcached, mysql, erlang, etc. also add users, ip addresses, etc.  Just about everything you would need to build a complete rails stack, with no hands.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://brainspl.at/articles/2008/11/18/ruby-deployment-and-engine-yard-as-a-service"&gt;Ezra&amp;#8217;s Slides&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;After talking to Ezra and Vivek Engine Yard As a Service is not necessarily a web service they provide but more of a stack as a service they provide.  Say you&amp;#8217;re locked into a contract with a hosting company or you love your hosting company but they don&amp;#8217;t know anything about building a rails stack or you&amp;#8217;re cheap and you want cheap &lt;span class="caps"&gt;VPS&lt;/span&gt;&amp;#8217;s, you run &lt;span class="caps"&gt;EYAS&lt;/span&gt; on your choice platform.  I asked a few questions about how Engine Yard intends to go about doing this, though partnership or through an install process for the end user and it sounded like some of those things are either secret or not defined yet.  Even with the specifics still a bit unclear the prospect is very exciting.&lt;/p&gt;</description>
      <pubDate>Tue, 18 Nov 2008 20:35:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:1b2ac971-2fca-4850-a829-9d1bd545665e</guid>
      <comments>http://www.actsasflinn.com/2008/11/18/engine-yard-as-a-service#comments</comments>
      <category>ruby</category>
      <category>rails</category>
      <category>engine</category>
      <category>yard</category>
      <category>prorubyconf08</category>
      <trackback:ping>http://www.actsasflinn.com/trackbacks?article_id=engine-yard-as-a-service&amp;day=18&amp;month=11&amp;year=2008</trackback:ping>
      <link>http://www.actsasflinn.com/2008/11/18/engine-yard-as-a-service</link>
    </item>
    <item>
      <title>#prorubyconf08</title>
      <description>&lt;p&gt;&lt;img src="http://actsasflinn.com/files/prorubyconf08.png" alt="Voices That Matter" style="float:right;margin:10px" /&gt;
I&amp;#8217;m at the Voices That Matter conf in Boston.  Met some old friends, met some new people.  Some talks are interesting as my team is mostly operating in a vacuum rails-wise.  Most of the  team has experience working at larger companies but not in rails at a larger company.  So it&amp;#8217;s nice to hear what other larger companies are doing and how their rails team fits in to the business.  The yellowpages.com talk was interesting to hear that most of their hits are static and not using ActiveRecord at all.  I&amp;#8217;m thinking that FanNation with it&amp;#8217;s large amount of dynamic requests is got to be one of the larger rails installations.  Also surprised to hear that &lt;span class="caps"&gt;NYT&lt;/span&gt; uses a handful of &lt;span class="caps"&gt;EC2&lt;/span&gt; instances to do mostly page cached/generated pages.  Again not much (if any) dynamic content generation.&lt;/p&gt;


	&lt;p&gt;At the end of the conference I won a prize (I think for talking a lot of shit on the irc back channel).  I picked Obie&amp;#8217;s book &lt;a href="http://www.amazon.com/gp/product/0321445619?ie=UTF8&amp;#38;linkCode=as2&amp;#38;camp=1789&amp;#38;creative=9325&amp;#38;tag=rubyfan-20&amp;#38;creativeASIN=0321445619"&gt;The Rails Way&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=rubyfan-20&amp;#38;l=as2&amp;#38;o=1&amp;#38;a=0321445619" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;.  The book is hugegantic weighing in at around 800 pages.  So far I&amp;#8217;ve skimmed the book and it looks promising.  Lots of code examples, etc.  I&amp;#8217;ll do a full review once I get to read it.&lt;/p&gt;</description>
      <pubDate>Tue, 18 Nov 2008 19:42:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:56e893b1-c6c5-4675-ae1c-384a3def7b11</guid>
      <comments>http://www.actsasflinn.com/2008/11/18/prorubyconf08#comments</comments>
      <category>ruby</category>
      <category>rails</category>
      <category>prorubyconf08</category>
      <trackback:ping>http://www.actsasflinn.com/trackbacks?article_id=prorubyconf08&amp;day=18&amp;month=11&amp;year=2008</trackback:ping>
      <link>http://www.actsasflinn.com/2008/11/18/prorubyconf08</link>
    </item>
    <item>
      <title>Hartford.rb on Merb</title>
      <description>&lt;p&gt;So after the last Hartford.rb meeting we started talking about the need for a web page.  I volunteered and started working on it a few nights ago.  I&amp;#8217;ve been working with Merb and I&amp;#8217;ve got to say that in the 2 months I&amp;#8217;ve been away a lot has changed.  I&amp;#8217;m using haml and while it feels a bit different it does kind of make sense.  So far the requirements are for pages, events and I think a way to upload documents and notes from meetings.  I&amp;#8217;m working on pages right now, slow going while I relearn Merb but happy to be working on something interesting and new.&lt;/p&gt;


	&lt;p&gt;What do other Ruby Brigades have on their websites?&lt;/p&gt;</description>
      <pubDate>Fri, 31 Oct 2008 02:42:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:65390b07-2403-4367-ac7b-2f11ff8dad14</guid>
      <comments>http://www.actsasflinn.com/2008/10/31/hartford-rb-on-merb#comments</comments>
      <category>merb</category>
      <category>ruby</category>
      <category>brigade</category>
      <category>hartford</category>
      <category>rb</category>
      <trackback:ping>http://www.actsasflinn.com/trackbacks?article_id=hartford-rb-on-merb&amp;day=31&amp;month=10&amp;year=2008</trackback:ping>
      <link>http://www.actsasflinn.com/2008/10/31/hartford-rb-on-merb</link>
    </item>
    <item>
      <title>Rails MemcachedStore for the Memcached Gem</title>
      <description>&lt;div style="float:right;margin:10px"&gt;&lt;a href="http://www.dumbgun.com/blog/2006/01/featured-t-shirt-goes-to-11.php"&gt;&lt;img src="http://www.dumbgun.com/click_men/10002_click_men.jpg" alt="11" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;I&amp;#8217;ve been experimenting with the &lt;a href="http://blog.evanweaver.com/files/doc/fauna/memcached/files/README.html"&gt;memcached gem&lt;/a&gt; (the c gem that runs up to 150x faster than memcache-client).  Merb already has pretty good &lt;a href="http://merbivore.com/documentation/0.9.9/doc/rdoc/merb-cache/index.html?a=F00000029&amp;#38;name=memcached_store.rb"&gt;support for the Memcached gem&lt;/a&gt; and in typical merb style does it better with fewer lines of code but I digress.  Here&amp;#8217;s my test implementation, so far so good nothing really heavy on it yet.  &lt;span class="caps"&gt;YMMV&lt;/span&gt; so be warned this is not tested in a production environment don&amp;#8217;t say I didn&amp;#8217;t warn you so and such.&lt;/p&gt;

&lt;pre style="clear:both"&gt;&lt;code&gt;
# in your environment file
config.cache_store = :memcached_store, 'localhost:11211'
&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code&gt;
# lib/memcached_store.rb
require 'memcached'

module ActiveSupport
  module Cache
    class MemcachedStore &amp;lt; Store
      attr_reader :addresses

      def initialize(*addresses)
        addresses = addresses.flatten
        options = addresses.extract_options!
        addresses = ["localhost"] if addresses.empty?
        @addresses = addresses
        @data = Memcached::Rails.new(addresses, options)
      end

      def read(key, options = nil)
        super
        @data.get(key, raw?(options))
      rescue Memcached::Error =&amp;gt; e
        logger.error("Memcached::Error (#{e}): #{e.message}")
        nil
      end

      # Set key = value. Pass :unless_exist =&amp;gt; true if you don't 
      # want to update the cache if the key is already set. 
      def write(key, value, options = nil)
        super
        method = options &amp;#38;&amp;#38; options[:unless_exist] ? :add : :set
        response = @data.send(method, key, value, expires_in(options), raw?(options))
        response == nil
      rescue Memcached::Error =&amp;gt; e
        logger.error("Memcached::Error (#{e}): #{e.message}")
        false
      end

      def delete(key, options = nil)
        super
        response = @data.delete(key, expires_in(options))
        response == nil
      rescue Memcached::Error =&amp;gt; e
        logger.error("Memcached::Error (#{e}): #{e.message}")
        false
      end

      def exist?(key, options = nil)
        # Doesn't call super, cause exist? in memcache is in fact a read
        # But who cares? Reading is very fast anyway
        !read(key, options).nil?
      end

      def increment(key, amount = 1)       
        log("incrementing", key, amount)

        @data.incr(key, amount)  
      rescue Memcached::Error
        nil
      end

      def decrement(key, amount = 1)
        log("decrement", key, amount)

        @data.decr(key, amount) 
      rescue Memcached::Error
        nil
      end        

      def delete_matched(matcher, options = nil)
        super
        raise "Not supported by Memcache" 
      end        

      def clear
        @data.flush_all
      end        

      def stats
        @data.stats
      end

      private
        def expires_in(options)
          (options &amp;#38;&amp;#38; options[:expires_in]) || 0
        end

        def raw?(options)
          options &amp;#38;&amp;#38; options[:raw]
        end
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;a href="http://snippy.actsasflinn.com/snippets/22"&gt;Snippet&lt;/a&gt;</description>
      <pubDate>Sun, 26 Oct 2008 01:55:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:da921b76-033c-40b5-ab54-4ca85956bc3f</guid>
      <comments>http://www.actsasflinn.com/2008/10/26/rails-memcachedstore-for-the-memcached-gem#comments</comments>
      <category>Rails</category>
      <category>Ruby</category>
      <category>rails</category>
      <category>cache</category>
      <category>memcached</category>
      <trackback:ping>http://www.actsasflinn.com/trackbacks?article_id=rails-memcachedstore-for-the-memcached-gem&amp;day=26&amp;month=10&amp;year=2008</trackback:ping>
      <link>http://www.actsasflinn.com/2008/10/26/rails-memcachedstore-for-the-memcached-gem</link>
    </item>
    <item>
      <title>Thoughts on User.current and Thread Safety</title>
      <description>&lt;div style="float:right;margin:10px"&gt;&lt;img style="width:200px" src="http://upload.wikimedia.org/wikipedia/commons/a/a4/Fingerhut.jpg" alt="A thimble" /&gt;&lt;/div&gt;

	&lt;p&gt;Pratik Naik has an interesting post &lt;a href="http://m.onkey.org/2008/10/23/thread-safety-for-your-rails"&gt;Thread safety for your Rails&lt;/a&gt; about what thread safety in Rails means (and what it doesn&amp;#8217;t).  One of the interesting points is that a common pattern of using class attributes is not thread safe and can lead to race conditions.  I found it interesting because I&amp;#8217;m a big proponent of User.current.  I&amp;#8217;ve always gotten great millage out of it and I&amp;#8217;ve always felt like it&amp;#8217;s a necessary evil for protecting user_id attributes from mass assignment and not totally driving yourself nuts with @foo.user_id = session[:user_id] all over your controller actions.&lt;/p&gt;


	&lt;p&gt;So the problem now is that if you ever intend to use User.current with a thread safe Rails app you&amp;#8217;ve got to adjust fire.  My thoughts are now turned toward investigating the following.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
class ApplicationController &amp;lt; ActionController::Base
 before_filter :current_user_id

 # Set the value
 def current_user_id
   Thread.current[:current_user_id] = session[:user_id]
 end
end

class User &amp;lt; ActiveRecord::Base
 def self.current
   Thread.current[:current_user] ||= self.fetch_by_id(Thread.current[:current_user_id])
 end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;a href="http://snippy.actsasflinn.com/snippets/21"&gt;Snippet&lt;/a&gt;

	&lt;p&gt;This seems like a thread safe method of accessing the current User without trading off the real functionality we want.&lt;/p&gt;</description>
      <pubDate>Sun, 26 Oct 2008 01:38:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:2c757a3c-0917-4681-a61d-7714a23c1d6c</guid>
      <comments>http://www.actsasflinn.com/2008/10/26/thoughts-on-user-current-and-thread-safety#comments</comments>
      <category>Rails</category>
      <category>Ruby</category>
      <category>rails</category>
      <category>cache</category>
      <category>thread</category>
      <category>user.current</category>
      <trackback:ping>http://www.actsasflinn.com/trackbacks?article_id=thoughts-on-user-current-and-thread-safety&amp;day=26&amp;month=10&amp;year=2008</trackback:ping>
      <link>http://www.actsasflinn.com/2008/10/26/thoughts-on-user-current-and-thread-safety</link>
    </item>
    <item>
      <title>Slicehost Acquired by Rackspace</title>
      <description>&lt;div style="float:right"&gt;&lt;a href="http://snippy.actsasflinn.com/slicehost"&gt;&lt;img src="http://www.slicehost.com/stylesheets/../images/logo.jpg" alt="Slicehost" /&gt;&lt;/a&gt;&lt;/div&gt;

	&lt;p&gt;In case you&amp;#8217;ve had your head in the sand the technology world is abuzz with hype about &amp;#8220;the cloud&amp;#8221;.  Last week Rackspace had there own little cloud announcement and I was grimacing with the thought of yet another large host entering the fray.  In case you don&amp;#8217;t know I&amp;#8217;m not a huge fan of &amp;#8220;the cloud,&amp;#8221; so I was imagining Rackspace might introduce yet another subpar on demand computing service.  I couldn&amp;#8217;t have been more wrong as it turns out.  Rackspace wasn&amp;#8217;t introducing a new unprove service, they were acquiring a proven leader already well respected in the industry, &lt;a href="http://snippy.actsasflinn.com/slicehost"&gt;Slicehost&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://snippy.actsasflinn.com/slicehost"&gt;Slicehost&lt;/a&gt; has been around for a few years now and has had such demand in the beginning I was on a waiting list.  It was worth it because the service has been great.  I&amp;#8217;ve been hosting &lt;a href="http://snippy.actsasflinn.com"&gt;Snippy&lt;/a&gt; for a little while now on it and a few other things and I&amp;#8217;m very happy.  I&amp;#8217;ve also had really great luck with Rackspace in the past so to hear that they were going to be adding their financial support and letting Slicehost run as a subsidiary is a awesome.&lt;/p&gt;


	&lt;p&gt;Slicehost will be able to keep it&amp;#8217;s great level of support and is already lowering the pricing on some of their existing slices.  &lt;a href="http://snippy.actsasflinn.com/slicehost"&gt;Check them out&lt;/a&gt; if you&amp;#8217;re looking for rails hosting, they&amp;#8217;&amp;#8216;re well worth it.&lt;/p&gt;</description>
      <pubDate>Sat, 25 Oct 2008 19:38:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:41de30c5-f376-4667-8736-5c83ea7a78b1</guid>
      <comments>http://www.actsasflinn.com/2008/10/25/slicehost-acquired-by-rackspace#comments</comments>
      <category>Rails</category>
      <category>rails</category>
      <category>hosting</category>
      <category>slicehost</category>
      <category>cloud</category>
      <trackback:ping>http://www.actsasflinn.com/trackbacks?article_id=slicehost-acquired-by-rackspace&amp;day=25&amp;month=10&amp;year=2008</trackback:ping>
      <link>http://www.actsasflinn.com/2008/10/25/slicehost-acquired-by-rackspace</link>
    </item>
    <item>
      <title>Rumbling!!!</title>
      <description>&lt;p&gt;@actsasflinn and @rvr are doing Rails Rumble.  We&amp;#8217;re super psyched to do our project, &lt;a href="http://specifics.r08.railsrumble.com"&gt;Specify&lt;/a&gt; a collaborative spec&amp;#8217;ing app.  We&amp;#8217;re just bootstrapping at this point but I&amp;#8217;ll be updating this post all along and on &lt;a href="http://twitter.com/actsasflinn"&gt;twitter&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Updates
2008-10-18 12:30:00 &lt;span class="caps"&gt;GMT&lt;/span&gt;-400 &amp;#8211; Got the deployment environment all set and started some simple account management work&amp;#8230;hmm saas railskit might have been handy.  Hitting the hay.&lt;/p&gt;


	&lt;p&gt;2008-10-25 15:35:00 &lt;span class="caps"&gt;GMT&lt;/span&gt;-400 &amp;#8211; Ugh, Rumble &lt;span class="caps"&gt;FAIL&lt;/span&gt;.  We bit off more than we could chew and tried to build in too much real world functionality.  In the end a line or so of code killed the project.  Maybe not a bad thing since there was a considerable amount of unfinished functionality.&lt;/p&gt;</description>
      <pubDate>Sat, 18 Oct 2008 02:48:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:67b6c9b8-6d09-404c-8f29-78c79f10612e</guid>
      <comments>http://www.actsasflinn.com/2008/10/18/rumbling#comments</comments>
      <category>Rails</category>
      <category>Ruby</category>
      <category>rails</category>
      <category>rumble</category>
      <trackback:ping>http://www.actsasflinn.com/trackbacks?article_id=rumbling&amp;day=18&amp;month=10&amp;year=2008</trackback:ping>
      <link>http://www.actsasflinn.com/2008/10/18/rumbling</link>
    </item>
  </channel>
</rss>
