From d5ac8f72af16fa5487ab1e16bf784e8125a7b450 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Wed, 27 Mar 2013 10:30:12 +0100 Subject: destinationable_type can be a non model string --- app/models/call_forward.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/models/call_forward.rb') diff --git a/app/models/call_forward.rb b/app/models/call_forward.rb index 195ac36..fcac294 100644 --- a/app/models/call_forward.rb +++ b/app/models/call_forward.rb @@ -2,7 +2,7 @@ class CallForward < ActiveRecord::Base attr_accessor :to_voicemail, :hunt_group_id - attr_accessible :phone_number_id, :call_forward_case_id, :timeout, + attr_accessible :call_forward_case_id, :timeout, :destination, :source, :depth, :active, :to_voicemail, :hunt_group_id, :call_forwardable_type, :call_forwardable_id, @@ -71,7 +71,7 @@ class CallForward < ActiveRecord::Base else destinationable_type = " #{self.destinationable_type}" end - if self.destinationable + if Module.constants.include?(destinationable_type.to_sym) && self.destinationable destination = "#{self.destinationable}#{destinationable_type}" else destination = "#{self.destination}#{destinationable_type}" -- cgit v1.2.3