From f274393cd7e9ed81084661ccefa1a2e53c49b50a Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 11 Mar 2013 13:46:24 +0100 Subject: Bugfix --- app/controllers/trigger_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/trigger_controller.rb b/app/controllers/trigger_controller.rb index db379f9..a1bab65 100644 --- a/app/controllers/trigger_controller.rb +++ b/app/controllers/trigger_controller.rb @@ -91,6 +91,8 @@ class TriggerController < ApplicationController if fax_document.save Notifications.new_fax(fax_document).deliver + @last_fax_document = fax_document + begin File.delete(pdf_file) rescue => e @@ -112,8 +114,8 @@ class TriggerController < ApplicationController if errors.count == 0 # Indicate a new fax in the navigation bar. # - if fax_document.fax_accountable.class == User - user = fax_document.fax_accountable + if @last_fax_document.fax_account.fax_accountable.class == User + user = @last_fax_document.fax_account.fax_accountable PrivatePub.publish_to("/users/#{user.id}/messages/new", "$('#new_voicemail_or_fax_indicator').hide('fast').show('slow');") end -- cgit v1.2.3