Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
#7 seedを複数プラットフォームに対応
Browse files Browse the repository at this point in the history
  • Loading branch information
naichilab committed Dec 27, 2017
1 parent 6b17697 commit e25dce1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,20 @@
end

users = User.all

categories = Category.all
platforms = Platform.all

50.times do |n|
game = FactoryBot.create(:game,
user: users.sample(1).first,
category: categories.sample(1).first)

rand(0..5).times do |n|
url = FactoryBot.create(:store_url,
game: game,
platform: platforms.sample(1).first)
end

# pp game
end

Expand Down

0 comments on commit e25dce1

Please sign in to comment.