summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-04-08 11:28:56 +0200
committerPeter Kozak <spag@golwen.net>2013-04-08 11:28:56 +0200
commit512c7e16b8164c85e4d6f473cf10bd25e6fc9ad2 (patch)
treebc827d89cdd1ff637d56bb3d4dd638dabc28b643 /app/models
parent8e501cb021c8977b21653d7050e8cde27b5c3546 (diff)
display related call_forwards
Diffstat (limited to 'app/models')
-rw-r--r--app/models/softkey.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/softkey.rb b/app/models/softkey.rb
index 27527f9..7e9b66d 100644
--- a/app/models/softkey.rb
+++ b/app/models/softkey.rb
@@ -35,10 +35,9 @@ class Softkey < ActiveRecord::Base
map{ |phone_number| phone_number.phone_numberable.hunt_group.id }.
uniq
- call_forwards = call_forwards + CallForward.where(:destinationable_type => 'HuntGroup', :destinationable_id => hunt_group_ids, :call_forwardable_type => 'PhoneNumber').
- where('call_forwardable_id NOT IN (?)', phone_numbers_ids)
+ call_forwards = call_forwards + CallForward.where(:destinationable_type => 'HuntGroup', :destinationable_id => hunt_group_ids, :call_forward_case_id => CallForwardCase.where(:value => 'assistant').first.try(:id))
- return call_forwards
+ return call_forwards.uniq
end
def possible_blf_sip_accounts