From 7d99513b56314b8bcb4d1fb0b48e9988f4f26bc1 Mon Sep 17 00:00:00 2001 From: dokkom Date: Mon, 27 Apr 2015 21:59:45 +0200 Subject: [PATCH 1/2] fidelio seed, works only in pbs wagon. (Dominic, Peter) --- db/seeds/development/1_people.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/db/seeds/development/1_people.rb b/db/seeds/development/1_people.rb index 4cfa8fe1b..a5a665ce5 100644 --- a/db/seeds/development/1_people.rb +++ b/db/seeds/development/1_people.rb @@ -36,6 +36,18 @@ def amount(role_type) seeder.seed_all_roles root = Group.root + +# Seed Max Mustermann, Fidelio as Abteilungsleiter Pfadi Patria +patria = Group.find_by_name('Patria') +seeder.seed_developer('Max Mustermann', 'fidelio@pfadipatria.com', patria, Group::Abteilung::Abteilungsleitung) +seeder.seed_role(Person.find_by_email('fidelio@pfadipatria.com'), patria, Group::Abteilung::Abteilungsleitung) + +person = Person.find_by_email('fidelio@pfadipatria.com') +person.nickname = 'Fidelio' +person.save + devs.each do |name, email| seeder.seed_developer(name, email, root, Group::Bund::MitarbeiterGs) end + + From 0924bf9d1ead6cf127f93397c7397c7c9115709f Mon Sep 17 00:00:00 2001 From: dokkom Date: Mon, 4 May 2015 15:10:09 +0200 Subject: [PATCH 2/2] cleaned code, Fidelio seed --- db/seeds/development/1_people.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/db/seeds/development/1_people.rb b/db/seeds/development/1_people.rb index a5a665ce5..3e143881b 100644 --- a/db/seeds/development/1_people.rb +++ b/db/seeds/development/1_people.rb @@ -37,6 +37,10 @@ def amount(role_type) root = Group.root +devs.each do |name, email| + seeder.seed_developer(name, email, root, Group::Bund::MitarbeiterGs) +end + # Seed Max Mustermann, Fidelio as Abteilungsleiter Pfadi Patria patria = Group.find_by_name('Patria') seeder.seed_developer('Max Mustermann', 'fidelio@pfadipatria.com', patria, Group::Abteilung::Abteilungsleitung) @@ -45,9 +49,3 @@ def amount(role_type) person = Person.find_by_email('fidelio@pfadipatria.com') person.nickname = 'Fidelio' person.save - -devs.each do |name, email| - seeder.seed_developer(name, email, root, Group::Bund::MitarbeiterGs) -end - -