title: Add Rows on Migrations
body: <p>I'd like to know which is the preferred way to add records to a database table in a Rails Migration. I've read on Ola Bini's book (Jruby on Rails) that he does something like this:</p>
  
  <pre><code>class CreateProductCategories &lt; ActiveRecord::Migration
  
    #defines the AR class
    class ProductType &lt; ActiveRecord::Base; end
  
    def self.up
  
      #CREATE THE TABLES...
  
      load_data
    end
    def self.load_data
      #Use AR object to create default data
      ProductType.create(:name =&gt; "type")
    end
  end
  </code></pre>
  
  <p>This is nice and clean but for some reason, doesn't work on the lasts versions of rails...</p>
  
  <p>The question is, how do you populate the database with default data (like users or something)?</p>
  
  <p>Thanks!</p>