From 961453a7a7d4926e837e9f9225074e3d0817f665 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Mon, 8 Jul 2013 13:24:52 +0200 Subject: destinationable_type can be nil --- app/models/call_forward.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/models') diff --git a/app/models/call_forward.rb b/app/models/call_forward.rb index 159eb84..0df2a35 100644 --- a/app/models/call_forward.rb +++ b/app/models/call_forward.rb @@ -90,25 +90,25 @@ class CallForward < ActiveRecord::Base end def destination_phone_number - if self.destinationable_type.downcase == 'phonenumber' + if self.destinationable_type.to_s.downcase == 'phonenumber' return self.destination end end def destination_phone_number=(destination_number) - if self.destinationable_type.downcase == 'phonenumber' + if self.destinationable_type.to_s.downcase == 'phonenumber' self.destination = destination_number end end def destination_greeting - if self.destinationable_type.downcase == 'voicemailaccount' + if self.destinationable_type.to_s.downcase == 'voicemailaccount' return self.destination end end def destination_greeting=(destination_file) - if self.destinationable_type.downcase == 'voicemailaccount' + if self.destinationable_type.to_s.downcase == 'voicemailaccount' self.destination = destination_file end end -- cgit v1.2.3