From 9f3da955f0a605a6f44a9935431a206ce5ee31fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Geuken?= Date: Fri, 17 Apr 2015 15:33:57 +0200 Subject: [PATCH] Move default value into else branch and remove superfluous variable --- app/models/event.rb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index a325b290..22689fe5 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -167,23 +167,22 @@ class Event < ActiveRecord::Base end def self.get_state_color(state) - # default azure - result = '#00FFFF' case state when 'new' # blue - result = '#0000FF' + '#0000FF' when 'withdrawn' # orange - result = '#FF8000' + '#FF8000' when 'confirmed' # green - result = '#00FF00' + '#00FF00' when 'unconfirmed' # yellow - result = '#FFFF00' + '#FFFF00' when 'rejected' # red - result = '#FF0000' + '#FF0000' when 'canceled' # grey - result = '#848484' + '#848484' + else + '#00FFFF' # azure end - result end def update_state(transition, mail = false, subject = false, send_mail = false, send_mail_param)