30. みなとRuby会議01
change
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do ¦t¦
t.string :name, :null => false
t.string :name_kana, :null => false
t.string :email, :null => false
t.string :password_hash
t.string :password_salt
t.timestamps
end
end
end 株式会社万葉
2012年6月4日月曜日
31. みなとRuby会議01
up & down
class RemoveNameKanaInUsers <
ActiveRecord::Migration
def up
remove_column :users, :name_kana
end
def down
add_column :users, :name_kana, :string
end
end
株式会社万葉
2012年6月4日月曜日
68. みなとRuby会議01
describe Project do
describe "#close" do
let(:proj) {Factory.create(:project, :closed => true)}
context "when closed" do
it {expect{proj.close}.to raise_error}
end
end
end
株式会社万葉
2012年6月4日月曜日