From 70bd720caf25971996c3173ed8d83851848914b7 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 9 Mar 2016 08:03:34 +0100 Subject: [PATCH] Improved creation of test tickets check. --- app/controllers/first_steps_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/first_steps_controller.rb b/app/controllers/first_steps_controller.rb index b9e449c57..a951016ac 100644 --- a/app/controllers/first_steps_controller.rb +++ b/app/controllers/first_steps_controller.rb @@ -186,7 +186,7 @@ class FirstStepsController < ApplicationController ) UserInfo.current_user_id = customer.id ticket = Ticket.create( - group_id: Group.find_by(active: true).id, + group_id: Group.find_by(active: true, name: 'Users').id, customer_id: customer.id, owner_id: User.find_by(login: '-').id, title: result[:subject], @@ -242,7 +242,7 @@ class FirstStepsController < ApplicationController if !test_customer test_ticket_active = false end - if Group.where(active: true).count > 1 + if Group.where(active: true, name: 'Users').count == 0 test_ticket_active = false end return result if test_ticket_active