title: UUIDs in Rails3
body: <p>I'm trying to setup my first Rails3 project and, early on, I'm running into problems with either <code>uuidtools</code>, my <code>UUIDHelper</code> or perhaps callbacks.  I'm obviously trying to use UUIDs and (I think) I've set things up as described in <a href="http://ariejan.net/2008/08/12/ruby-on-rails-uuid-as-your-activerecord-primary-key/" rel="noreferrer">Ariejan de Vroom's article</a>. I've tried using the UUID as a primary key and also as simply a supplemental field, but it seems like the <code>UUIDHelper</code> is never being called.</p>
  
  <p>I've read many mentions of callbacks and/or helpers changing in Rails3, but I can't find any specifics that would tell me how to adjust. Here's my setup as it stands at this moment (there have been a few iterations):</p>
  
  <pre><code># migration
  class CreateImages &lt; ActiveRecord::Migration
    def self.up
      create_table :images do |t|
        t.string :uuid, :limit  =&gt; 36
        t.string :title
        t.text :description
  
        t.timestamps
      end
    end
    ...
  end
  
  # lib/uuid_helper.rb
  require 'rubygems'
  require 'uuidtools'
  
  module UUIDHelper
    def before_create()
      self.uuid = UUID.timestamp_create.to_s
    end
  end
  
  # models/image.rb
  class Image &lt; ActiveRecord::Base
    include UUIDHelper
  
    ...
  end
  </code></pre>
  
  <p>Any insight would be much appreciated.</p>
  
  <p>Thanks.</p>