From 6887e72ac93579de58991205bb6f0bf20a873dc3 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Fri, 24 Jul 2015 15:20:22 +0200 Subject: [PATCH] Fixed bugs: Refactored method calls didn't work as expected. --- lib/import/otrs.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/import/otrs.rb b/lib/import/otrs.rb index e07a5145a..7159fcce9 100644 --- a/lib/import/otrs.rb +++ b/lib/import/otrs.rb @@ -564,7 +564,7 @@ module Import::OTRS end # update or create ticket - ticket_old = Ticket.find(ticket_new[:id]) + ticket_old = Ticket.find_by(id: ticket_new[:id]) if ticket_old log "update Ticket.find(#{ticket_new[:id]})" ticket_old.update_attributes(ticket_new) @@ -787,7 +787,7 @@ module Import::OTRS created_at: history['CreateTime'], created_by_id: history['CreateBy'] ) - elsif history['ArticleID'] && !history['ArticleID'].zero? + elsif history['ArticleID'] && !history['ArticleID'].to_i.zero? History.add( id: history['HistoryID'], o_id: history['ArticleID'],