adds tags to spending proposals in dev_seeds

This commit is contained in:
kikito
2016-03-14 15:00:49 +01:00
parent 788ec7b09c
commit f4f491748f

View File

@@ -252,6 +252,8 @@ end
puts "Creating Spending Proposals" puts "Creating Spending Proposals"
tags = Faker::Lorem.words(10)
(1..30).each do |i| (1..30).each do |i|
geozone = Geozone.reorder("RANDOM()").first geozone = Geozone.reorder("RANDOM()").first
author = User.reorder("RANDOM()").first author = User.reorder("RANDOM()").first
@@ -262,6 +264,7 @@ puts "Creating Spending Proposals"
description: description, description: description,
created_at: rand((Time.now - 1.week) .. Time.now), created_at: rand((Time.now - 1.week) .. Time.now),
geozone: [geozone, nil].sample, geozone: [geozone, nil].sample,
tag_list: tags.sample(3).join(','),
terms_of_service: "1") terms_of_service: "1")
puts " #{spending_proposal.title}" puts " #{spending_proposal.title}"
end end
@@ -295,4 +298,4 @@ puts "Confirming hiding in debates, comments & proposals"
Comment.only_hidden.flagged.reorder("RANDOM()").limit(10).each(&:confirm_hide) Comment.only_hidden.flagged.reorder("RANDOM()").limit(10).each(&:confirm_hide)
Debate.only_hidden.flagged.reorder("RANDOM()").limit(5).each(&:confirm_hide) Debate.only_hidden.flagged.reorder("RANDOM()").limit(5).each(&:confirm_hide)
Proposal.only_hidden.flagged.reorder("RANDOM()").limit(5).each(&:confirm_hide) Proposal.only_hidden.flagged.reorder("RANDOM()").limit(5).each(&:confirm_hide)