From ce436c6f01aad4fad37e185af84c72814e7f771b Mon Sep 17 00:00:00 2001 From: Thorsten Date: Mon, 5 Dec 2016 10:19:18 +0100 Subject: [PATCH] Use guard clause --- app/models/cti/caller_id.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/cti/caller_id.rb b/app/models/cti/caller_id.rb index 71fe4291f..e591f5a98 100644 --- a/app/models/cti/caller_id.rb +++ b/app/models/cti/caller_id.rb @@ -23,10 +23,9 @@ module Cti o_id: data[:o_id], user_id: data[:user_id], ) - if record.new_record? - record.comment = data[:comment] - record.save! - end + return if !record.new_record? + record.comment = data[:comment] + record.save! end =begin