2015-09-11 13:47:37 +00:00
|
|
|
# inital data set as extention to db/seeds.rb
|
2016-01-19 22:30:23 +00:00
|
|
|
|
2016-05-03 00:36:44 +00:00
|
|
|
Trigger.destroy_all
|
|
|
|
Job.destroy_all
|
|
|
|
|
2016-01-19 22:30:23 +00:00
|
|
|
# create email address and apply it to all groups
|
2016-04-26 10:59:50 +00:00
|
|
|
channel_id = nil
|
|
|
|
channel = Channel.find_by(area: 'Email::Notification', active: true)
|
|
|
|
if channel
|
2016-04-26 12:42:55 +00:00
|
|
|
channel_id = channel.id
|
2016-04-26 10:59:50 +00:00
|
|
|
end
|
|
|
|
|
2016-04-26 12:42:55 +00:00
|
|
|
email_address = EmailAddress.create_or_update(
|
2015-09-11 13:47:37 +00:00
|
|
|
realname: 'Zammad',
|
|
|
|
email: 'zammad@localhost',
|
2016-04-26 10:59:50 +00:00
|
|
|
channel_id: channel_id,
|
2015-09-11 13:47:37 +00:00
|
|
|
updated_by_id: 1,
|
|
|
|
created_by_id: 1
|
|
|
|
)
|
2017-10-01 12:25:52 +00:00
|
|
|
Group.all.each do |group|
|
2015-09-11 13:47:37 +00:00
|
|
|
group.email_address_id = email_address.id
|
2017-11-06 01:32:47 +00:00
|
|
|
group.save!
|
2017-10-01 12:25:52 +00:00
|
|
|
end
|
2017-11-06 01:32:47 +00:00
|
|
|
|
|
|
|
User.create_or_update(
|
|
|
|
login: 'admin@example.com',
|
|
|
|
firstname: 'Default',
|
|
|
|
lastname: 'Admin',
|
|
|
|
email: 'admin@example.com',
|
|
|
|
password: 'adminpw',
|
|
|
|
active: true,
|
2017-11-23 08:09:44 +00:00
|
|
|
roles: Role.where(name: %w[Admin]),
|
2017-11-06 01:32:47 +00:00
|
|
|
updated_by_id: 1,
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|