summaryrefslogtreecommitdiff
path: root/app/models/sip_account.rb
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-02-27 06:04:50 -0500
committerPeter Kozak <spag@golwen.net>2013-02-27 06:04:50 -0500
commited0117210837dd1d0d2dbf403799b70225caf0cd (patch)
treec7f27eba275bbedf0505e9078592f562f37e2bbe /app/models/sip_account.rb
parent22eb173c74893114350e4b5351a58b48673f63b3 (diff)
calls views added
Diffstat (limited to 'app/models/sip_account.rb')
-rw-r--r--app/models/sip_account.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb
index 034af7c..2040b41 100644
--- a/app/models/sip_account.rb
+++ b/app/models/sip_account.rb
@@ -38,6 +38,8 @@ 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}@%'" }
+
# Delegations:
#
delegate :host, :to => :sip_domain, :allow_nil => true