RailsCasts Pro episodes are now free!

Learn more or hide this

Paul Beattie's Profile

GitHub User: paulbeattie

Site: http://paul-beattie.com

Comments by Paul Beattie

Avatar

Thanks for posting, very useful.

Although you shouldn't need the id => false in the create_table declaration. The example given from Matt Bauer from what I can see is using the id as the bigint column whereas here we have replaced it with tweet_id. I have tested this myself and I can confirm it works.

ruby
class CreateLatestTweets < ActiveRecord::Migration
  def change
    create_table :latest_tweets do |t|
      t.integer :tweet_id, :limit => 8
      t.text :content
      t.timestamp :posted_at

      t.timestamps
    end
  end
end