<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <atom:link href="http://www.infused.org/feed/atom" rel="self" type="application/rss+xml"/>
    <title>infused.org</title>
    <link>http://www.infused.org/posts</link>
    <description>infused.org blog</description>
    <item>
      <title>Not Just Pretty Pictures</title>
      <link>http://www.infused.org/posts/324</link>
      <description>&lt;a href="http://heritage-key.com/blogs/owenjarus/ancient-british-language-discovered-pictish-symbols-are-scotlands-hieroglyphs"&gt;Ancient British Language Discovered: Pictish Symbols are Scotland's Hieroglyphs&lt;/a&gt;

&gt; New research has shown that the symbols used by the ancient
&gt; Picts were an actual written language - not symbology.




</description>
      <guid>http://www.infused.org/2010/04/10/not-just-pretty-pictures/</guid>
      <pubDate>Sat, 10 Apr 2010 00:17:45 +0000</pubDate>
      <copyright>Copyright 2010, Keith Morrison</copyright>
      <language>en</language>
    </item>
    <item>
      <title>Spain 2009</title>
      <link>http://www.infused.org/posts/323</link>
      <description>We spent most of December in Spain and had a great time. &lt;a href="http://www.flickr.com/photos/infused/sets/72157622999099163/show/"&gt;See all the photos here&lt;/a&gt;.

&lt;a href="http://www.flickr.com/photos/infused/4238182967/in/set-72157622999099163/lightbox/" target="_blank"&gt;
  &lt;img src="http://farm3.static.flickr.com/2616/4238182967_1547875191_z.jpg" /&gt;
&lt;/a&gt;

&lt;a href="http://www.flickr.com/photos/infused/4238969998/in/set-72157622999099163/lightbox/" target="_blank"&gt;
  &lt;img src="http://farm5.static.flickr.com/4011/4238969998_7572e544d7_z.jpg" /&gt;
&lt;/a&gt;

&lt;a href="http://www.flickr.com/photos/infused/4238173841/in/set-72157622999099163/lightbox/" target="_blank"&gt;
  &lt;img src="http://farm5.static.flickr.com/4038/4238173841_c47da7baf8_z.jpg" /&gt;
&lt;/a&gt;
</description>
      <guid>http://www.infused.org/2010/01/04/spain-2009/</guid>
      <pubDate>Mon, 04 Jan 2010 17:32:45 +0000</pubDate>
      <copyright>Copyright 2010, Keith Morrison</copyright>
      <language>en</language>
    </item>
    <item>
      <title>DBF 1.0.9 update</title>
      <link>http://www.infused.org/posts/322</link>
      <description>[DBF](http://github.com/infused/dbf/tree/master) is a small fast Ruby library for reading dBase, xBase, Clipper and FoxPro database files

Changes in version 1.0.9:

* Fix incorrect integer column values (only affecting some dbf files)
* Add CSV export</description>
      <guid>http://www.infused.org/2009/01/15/dbf-109-update/</guid>
      <pubDate>Thu, 15 Jan 2009 12:32:44 +0000</pubDate>
      <copyright>Copyright 2009, Keith Morrison</copyright>
      <language>en</language>
    </item>
    <item>
      <title>The Blame Game</title>
      <link>http://www.infused.org/posts/321</link>
      <description>In just about every Rails project I've worked on over the last several years we've needed track the user who creates and updates database records.  The most popular solution seems to be DeLynn Berry's userstamp plugin and, until recently, that's what we've always chosen to use too.  But after fighting incompatibility with newer versions of Rails I decided to write my own plugin.  Enter &lt;a href="http://github.com/infused/blame/tree/master"&gt;Blame&lt;/a&gt;.

Blame automatically userstamps create and update operations if the table has columns named created_by and/or updated_by.

Installation:
  
    ruby script/plugin install git://github.com/infused/blame.git

Blame assumes that you are using &lt;a href="http://github.com/technoweenie/restful-authentication/tree/master"&gt;restful-authentication&lt;/a&gt; and expects User.current_user to return the current user. You can override this behavior by overriding the default userstamp_object method in ActiveRecord::Base or in any of your models. For example, maybe you just want to find the current user bases on the a session variable:

    :::ruby
    # In environment.rb
    class ActiveRecord::Base
      def userstamp_object
        User.find(session[:user_id])
      end
    end

Maybe you don't like the default column names of created_by/updated_by. You can customize the column names globally or for individual models:

    :::ruby
    # Globally in environment.rb
    ActiveRecord::Base.created_userstamp_column = :creator_id
    
    # In a model definition
    class Subscription
      self.created_userstamp_column = :creator_id
      self.updated_userstamp_column = :updater_id
    end

Automatic userstamping can be turned off by setting record_userstamps:

    :::ruby
    # Globally in environment.rb
    ActiveRecord::Base.record_userstamps = false
    
    # In a model definition
    class Subscription
      self.record_userstamps = false
    end

Blame also adds a migration helper which will add the created_by and updated_by columns (or your custom column names) to your table:

    :::ruby
    create_table :widgets do |t|
      t.string :name
      t.timestamps
      t.userstamps
    end
</description>
      <guid>http://www.infused.org/2009/01/05/the-blame-game/</guid>
      <pubDate>Mon, 05 Jan 2009 17:20:07 +0000</pubDate>
      <copyright>Copyright 2009, Keith Morrison</copyright>
      <language>en</language>
    </item>
    <item>
      <title>DBF 1.0.6 update</title>
      <link>http://www.infused.org/posts/319</link>
      <description>[DBF](http://github.com/infused/dbf/tree/master) is a small fast library for reading dBase, xBase, Clipper and FoxPro database files. It is written completely in Ruby and has no external dependencies.

Changes in version 1.0.5:

* Strip non-ascii characters from column names


</description>
      <guid>http://www.infused.org/2007/11/27/dbf-106-update/</guid>
      <pubDate>Tue, 27 Nov 2007 22:43:13 +0000</pubDate>
      <copyright>Copyright 2007, Keith Morrison</copyright>
      <language>en</language>
    </item>
    <item>
      <title>DBF 1.0.2 Update</title>
      <link>http://www.infused.org/posts/318</link>
      <description>[DBF](http://github.com/infused/dbf/tree/master) is a small fast library for reading dBase, xBase, Clipper and FoxPro database files. It is written completely in Ruby and has no external dependencies.

Changes in version 1.0.2:

* Fixes a bug when reading Visual Foxpro memo files.


</description>
      <guid>http://www.infused.org/2007/08/15/dbf-102-update/</guid>
      <pubDate>Wed, 15 Aug 2007 14:50:50 +0000</pubDate>
      <copyright>Copyright 2007, Keith Morrison</copyright>
      <language>en</language>
    </item>
    <item>
      <title>Dylan</title>
      <link>http://www.infused.org/posts/317</link>
      <description>Today my son Dylan is 1 week old.  It's been an amazing experience so far and I'm sure it will only get better as he becomes more interactive. This is the first time I've had any time to sit down and catch up on email, blogs, programming, etc.  He's in my lap now, and I've been working with him in the crook of my arm for the last two hours.  It's surprisingly easy to do while he's still small and sleeps most of the time!

Dylan at 1 day old:

&lt;img src="http://farm4.static.flickr.com/3390/4641353088_fdd7475367_o.jpg" alt="Dylan - 1 day old" /&gt;

</description>
      <guid>http://www.infused.org/2007/07/09/dylan/</guid>
      <pubDate>Mon, 09 Jul 2007 16:31:20 +0000</pubDate>
      <copyright>Copyright 2007, Keith Morrison</copyright>
      <language>en</language>
    </item>
    <item>
      <title>DBF 0.5.0 Update</title>
      <link>http://www.infused.org/posts/316</link>
      <description>A lot of work has gone into this release of the [DBF](http://github.com/infused/dbf/tree/master) gem.  The basic reader code is stable now. I'm in the process of moving the test suite from Test::Unit to Rspec. When I'm done with that I'll add a couple of additional features, polish the documentation and christen it 1.0.0.

* New find method
* Full compatibility with the two flavors of memo file
* Two modes of operation: In memory, or File I/O
* Improved [documentation](http://rdoc.info/projects/infused/dbf) and more usage examples</description>
      <guid>http://www.infused.org/2007/05/26/dbf-050-update/</guid>
      <pubDate>Sat, 26 May 2007 02:11:40 +0000</pubDate>
      <copyright>Copyright 2007, Keith Morrison</copyright>
      <language>en</language>
    </item>
    <item>
      <title>Returning supported HTTP methods with 'verify'</title>
      <link>http://www.infused.org/posts/315</link>
      <description>When using Rails' [verify](http://api.rubyonrails.com/classes/ActionController/Verification/ClassMethods.html#M000175) method to protect your ActionController actions, you should return a list of the allowed HTTP methods in the response headers.

Let's say you have an action called update that you want to protect from anything but a POST.  I like to do it like this:

    :::ruby
    verify :method =&gt; :post, 
      :only =&gt; :update, 
      :render =&gt; {:text =&gt; '405 HTTP POST required', :status =&gt; 405}, 
      :add_headers =&gt; {'Allow' =&gt; 'POST'} 

Now if someone tries to hit the update action with anything other than a POST, an error message will be displayed and the response headers will contain (among other things):

    :::ruby
    {"Status" =&gt; "405 Method Not Allowed", "Allow" =&gt; "POST"}

In my opinion, this is a better way to go than redirecting to another action because the use of an improper HTTP method is most likely the result of either programmer error or malicious intent.  By redirecting to another page, you are making it much easier to for somebody to take your site down with a denial of service attack and if it's a programming error, you'll locate the problem faster.

You should also make sure that you have a functional test for this behavior:

    :::ruby
    def test_invalid_update_methods
      [:get, :put, :delete].each do |http_method|
        send http_method, :update
        assert_response 405
        assert_equal 'POST', @response.headers['Allow']
        assert_equal '405 HTTP POST required', @response.body
      end
    end

### Additional Resources

* [HTTP 1.1: Status Code Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html)
* [HTTP 1.1: Header Field Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html)
* [Rails API Documentation: Verification](http://api.rubyonrails.com/classes/ActionController/Verification/ClassMethods.html#M000175)</description>
      <guid>http://www.infused.org/2007/02/12/376/</guid>
      <pubDate>Mon, 12 Feb 2007 19:36:40 +0000</pubDate>
      <copyright>Copyright 2007, Keith Morrison</copyright>
      <language>en</language>
    </item>
    <item>
      <title>Going Nowhere for RailsConf 2007 </title>
      <link>http://www.infused.org/posts/314</link>
      <description>&lt;a href="http://conferences.oreillynet.com/rails/"&gt;RailsConf&lt;/a&gt; will be held right here in Portland this year, so no travelling for me this time around.  The conference is being held at the Oregon Convention Center (the same place OSCON is held every year), so it's a huge improvement over the shitty hotel in Chicago where it was held last year.

Registration just opened a couple of hours ago.  This year the registration fee is higher and the venue is a lot larger so it probably won't sell out as quickly as last year.  But, if you want to go, I would sign up soon.  I already did.

Updates:

* 7 hours later: I'm glad I bought mine early, because &lt;a href="http://weblog.rubyonrails.com/2007/2/2/one-third-of-railsconf-07-seats-gone"&gt;they might sell out faster than last year&lt;/a&gt;.
* 3 days later: &lt;a href="http://www.37signals.com/svn/posts/250-railsconf-07-sells-faster-than-any-other-oreilly-conference"&gt;RailsConf '07 sells faster than any other O'Reilly conference&lt;/a&gt;
* 9 days later: &lt;a href="http://weblog.rubyonrails.com/2007/2/11/railsconf-sells-more-than-2-3s-railsconf-eu-rfp-open"&gt;close to 75%&lt;/a&gt; of the tickets have now been sold.
* 22 days later: &lt;a href="http://weblog.rubyonrails.com/2007/2/24/railsconf-07-sold-out"&gt;Sold out&lt;/a&gt;</description>
      <guid>http://www.infused.org/2007/02/02/going-nowhere-for-railsconf-2007/</guid>
      <pubDate>Fri, 02 Feb 2007 15:49:29 +0000</pubDate>
      <copyright>Copyright 2007, Keith Morrison</copyright>
      <language>en</language>
    </item>
  </channel>
</rss>
