From cfd5b52fb9f4ef643d995539c678f8b9af0a089b Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 7 Nov 2014 01:08:04 +0100 Subject: [PATCH] Small improvements. --- db/seeds.rb | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 3f3513ac3..3ac2e4064 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1262,17 +1262,6 @@ Group.create_if_not_exists( :updated_by_id => 1, :created_by_id => 1 ) -Group.create_if_not_exists( - :id => 2, - :name => 'Twitter', - :note => 'All Tweets.', - :updated_by_id => 1, - :created_by_id => 1 -) - -roles = Role.where( :name => 'Customer' ) -organizations = Organization.all -groups = Group.all user = User.create_if_not_exists( :login => '-', @@ -1281,23 +1270,26 @@ user = User.create_if_not_exists( :email => '', :password => 'root', :active => false, - :roles => roles, - :groups => groups, - :organizations => organizations, :updated_by_id => 1, :created_by_id => 1 ) + UserInfo.current_user_id = 1 -user_community = User.create_if_not_exists( - :login => 'nicole.braun@zammad.org', - :firstname => 'Nicole', - :lastname => 'Braun', - :email => 'nicole.braun@zammad.org', - :password => '', - :active => true, - :roles => roles, -# :groups => groups, - :organizations => organizations, +roles = Role.where( :name => 'Customer' ) +organizations = Organization.all +groups = Group.all +org_community = Organization.create_if_not_exists( + :name => 'Zammad Foundation', +) +user_community = User.create_or_update( + :login => 'nicole.braun@zammad.org', + :firstname => 'Nicole', + :lastname => 'Braun', + :email => 'nicole.braun@zammad.org', + :password => '', + :active => true, + :roles => roles, + :organization_id => org_community.id, ) Link::Type.create_if_not_exists( :name => 'normal' )