Skip to content

Instantly share code, notes, and snippets.

@joonyou
Created May 7, 2010 16:33
Show Gist options
  • Save joonyou/393680 to your computer and use it in GitHub Desktop.
Save joonyou/393680 to your computer and use it in GitHub Desktop.
active record test
%w(rubygems active_record sqlite3).each {|lib| require lib}
ActiveRecord::Base.establish_connection({:adapter => 'sqlite3',
:database => 'rtest.sqlite3'
})
class TestMigration < ActiveRecord::Migration
def self.up
create_table :joons do |t|
t.string :name
t.string :status
end
end
end
TestMigration.migrate(:up)
class Joon < ActiveRecord::Base
end
Joon.new({:name => 'Ellen', :status => 'daughter'}).save
Joon.new({:name => 'Joon', :status => 'rubyhead'}).save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment