Sha256: 7f8c204eb87cd0ecf06e3770c1a2cf233e3ec4bee407a1741cae142e758738b7

Contents?: true

Size: 809 Bytes

Versions: 26

Compression:

Stored size: 809 Bytes

Contents

class PopulateData < ActiveRecord::Migration
  def change
    # name:string age:integer salary:decimal bio:text
    user_1 = User.create(:name => "John Smith", :age => 30, :salary => 123.45, :bio => 'This is text')
    user_2 = User.create(:name => "Bob Jones", :age => 22, :salary => nil, :bio =>'This is BIO')
    user_3 = User.create(:name => "Anna Smith", :age => 28, :salary => 100, :bio =>'This is another text')
    Comment.create(:user_id => user_1.id, :comment => 'This is comment #1')
    Comment.create(:user_id => user_1.id, :comment => 'This is comment #2')
    Comment.create(:user_id => user_2.id, :comment => 'This is comment #3')
    Comment.create(:user_id => user_3.id, :comment => 'This is comment #4')
    Comment.create(:user_id => user_3.id, :comment => 'This is comment #5')
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
rails_db-1.6.0 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-1.5.0 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-1.4.1 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-1.4.0 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-1.3.4 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-1.3.3 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-1.3.2 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-1.3.1 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-1.3 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-1.1.1 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-1.1 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-1.0 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-0.9.9 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-0.9 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-0.8 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-0.7.2 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-0.7.1 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-0.7 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-0.6 test/dummy/db/migrate/20151013204027_populate_data.rb
rails_db-0.5.1 test/dummy/db/migrate/20151013204027_populate_data.rb