summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/call.rb2
-rw-r--r--app/models/sip_account.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/call.rb b/app/models/call.rb
index db6d9d6..b0cd9b2 100644
--- a/app/models/call.rb
+++ b/app/models/call.rb
@@ -1,5 +1,5 @@
class Call < ActiveRecord::Base
- self.table_name = 'detailed_calls'
+ self.table_name = 'calls_active'
self.primary_key = 'uuid'
attr_writer :sip_account_id
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb
index 1499d62..81b9c1c 100644
--- a/app/models/sip_account.rb
+++ b/app/models/sip_account.rb
@@ -38,7 +38,7 @@ class SipAccount < ActiveRecord::Base
has_many :ringtones, :as => :ringtoneable, :dependent => :destroy
- has_many :calls, :finder_sql => lambda { |s| "SELECT DISTINCT detailed_calls.* FROM detailed_calls WHERE presence_id LIKE '#{self.auth_name}@%' OR b_presence_id LIKE '#{self.auth_name}@%'" }
+ has_many :calls, :finder_sql => lambda { |s| "SELECT DISTINCT calls_active.* FROM calls_active WHERE sip_account_id = #{self.id} OR b_sip_account_id = #{self.id}" }
# Delegations:
#