summaryrefslogtreecommitdiff
path: root/app/models/switchboard.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/switchboard.rb')
-rw-r--r--app/models/switchboard.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/switchboard.rb b/app/models/switchboard.rb
index 73219e8..d62657f 100644
--- a/app/models/switchboard.rb
+++ b/app/models/switchboard.rb
@@ -25,7 +25,7 @@ class Switchboard < ActiveRecord::Base
}
belongs_to :user, :touch => true
-
+
has_many :switchboard_entries, :dependent => :destroy
has_many :switchable_switchboard_entries, :class_name => "SwitchboardEntry", :conditions => {:switchable => true}
@@ -41,11 +41,11 @@ class Switchboard < ActiveRecord::Base
end
def active_calls
- Call.where("sip_account_id = ? or b_sip_account_id = ?", self.switchable_sip_account_ids, self.switchable_sip_account_ids)
+ Call.where("sip_account_id = ? or b_sip_account_id = ?", self.switchable_sip_account_ids, self.switchable_sip_account_ids).order(:start_stamp)
end
def dispatchable_incoming_calls
- Call.where("b_sip_account_id = ?", self.switchable_sip_account_ids)
+ Call.where("b_sip_account_id = ?", self.switchable_sip_account_ids).order(:start_stamp)
end
private