summaryrefslogtreecommitdiff
path: root/app/models/call_history.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-06-20 19:06:19 +0200
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-06-20 19:06:19 +0200
commiteb0e1cc5c26275ff3e5c341404e8bc558f8312b8 (patch)
tree71f449ccd6f15422717de3ac24f87d5e888ddd79 /app/models/call_history.rb
parentdf6e17e48995f25e72509986f30700d778b179b6 (diff)
parent3b27a5d45b12f6bac65da2a8e17387bfda42a2f1 (diff)
Merge branch 'develop'
Diffstat (limited to 'app/models/call_history.rb')
-rw-r--r--app/models/call_history.rb19
1 files changed, 7 insertions, 12 deletions
diff --git a/app/models/call_history.rb b/app/models/call_history.rb
index 81342bd..8ccf4e3 100644
--- a/app/models/call_history.rb
+++ b/app/models/call_history.rb
@@ -133,19 +133,14 @@ class CallHistory < ActiveRecord::Base
end
- def voicemail_message?
- begin
- return self.call_historyable.voicemail_messages.where(:forwarded_by => self.caller_channel_uuid).any?
- rescue
- return nil
- end
- end
-
def voicemail_message
- begin
- return self.call_historyable.voicemail_messages.where(:forwarded_by => self.caller_channel_uuid).first
- rescue
- return nil
+ if self.callee_account_type.downcase == 'voicemailaccount'
+ voicemail_account = VoicemailAccount.where(:id => self.callee_account_id).first
+ if voicemail_account
+ return voicemail_account.voicemail_messages.where(:forwarded_by => self.caller_channel_uuid).first
+ else
+ return nil
+ end
end
end