Add progress bars dev seeds

This commit is contained in:
Javi Martín
2019-01-15 14:36:40 +01:00
committed by decabeza
parent 7317238382
commit 0a710a77f2

View File

@@ -22,7 +22,24 @@ section "Creating investment milestones" do
end
end
end
if rand < 0.8
record.progress_bars.create!(kind: :primary, percentage: rand(ProgressBar::RANGE))
end
rand(0..3).times do
progress_bar = record.progress_bars.build(
kind: :secondary,
percentage: rand(ProgressBar::RANGE)
)
random_locales.map do |locale|
Globalize.with_locale(locale) do
progress_bar.title = "Description for locale #{locale}"
progress_bar.save!
end
end
end
end
end
end