Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,14 @@ namespace "db" do
task "setup" do
puts "Setting up databases"
run_in_dummy_app "rm -f db/*.sqlite3"
run_in_dummy_app "RAILS_ENV=development rake db:schema:load db:seed"
run_in_dummy_app "RAILS_ENV=production rake db:schema:load db:seed"
run_in_dummy_app "RAILS_ENV=test rake db:environment:set db:schema:load"
puts "Setting up development database"
run_in_dummy_app "RAILS_ENV=development rake db:schema:load db:seed --trace"
puts "Setting up production database"
run_in_dummy_app "RAILS_ENV=production rake db:schema:load --trace"
puts "Setting up production database(db:seed)"
run_in_dummy_app "RAILS_ENV=production rake db:seed --trace"
puts "Setting up test database"
run_in_dummy_app "RAILS_ENV=test rake db:environment:set db:schema:load --trace"
puts "Finish setting up databases"
end
end
1 change: 1 addition & 0 deletions spec/dummy/db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
puts "load seeds.rb"
Post.delete_all
Post.create id: 1
Loading