Added newsletters to dev_seeds

This commit is contained in:
María Checa
2018-02-13 16:18:19 +01:00
parent 7b71aaded7
commit 20de8c81f7
2 changed files with 19 additions and 0 deletions

View File

@@ -823,4 +823,6 @@ section "Creating legislation processes" do
end
end
require_relative 'dev_seeds/newsletters'
log "All dev seeds created successfuly 👍"

View File

@@ -0,0 +1,17 @@
section "Creating Newsletters" do
newsletter_body = [
"We choose to go to the moon in this decade and do the other things, not because they are easy, but because they are hard, because that goal will serve to organize and measure the best of our energies and skills, because that challenge is one that we are willing to accept, one we are unwilling to postpone, and one which we intend to win.",
"Spaceflights cannot be stopped. This is not the work of any one man or even a group of men. It is a historical process which mankind is carrying out in accordance with the natural laws of human development.",
"Many say exploration is part of our destiny, but its actually our duty to future generations and their quest to ensure the survival of the human species."
]
5.times do |n|
Newsletter.create!(
subject: "Newsletter subject #{n}",
segment_recipient: Newsletter.segment_recipients.values.sample,
from: 'no-reply@consul.dev',
body: newsletter_body.sample,
sent_at: [Time.now, nil].sample
)
end
end