summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-27 20:53:10 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-27 20:53:10 +0100
commit46eb56627a0d1f5142b79b476bbeb96f91a157d9 (patch)
tree0bdd9939964491576087d8d8a653e26543bf704a /app/models
parent67c1a0a951403a546250ea860a3e3d199cae2fce (diff)
parentef2acbfebeefdd17f8896a3e5eb44775febf4dee (diff)
Merge branch 'develop'5.1-beta7
Diffstat (limited to 'app/models')
-rw-r--r--app/models/conference.rb4
-rw-r--r--app/models/sip_account.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/conference.rb b/app/models/conference.rb
index 8c5a752..aee75d5 100644
--- a/app/models/conference.rb
+++ b/app/models/conference.rb
@@ -31,7 +31,7 @@ class Conference < ActiveRecord::Base
validate :start_and_end_dates_must_make_sense, :if => Proc.new { |conference| !conference.start.blank? && !conference.end.blank? }
- after_save :send_pin_email_when_pin_has_changed
+ before_save :send_pin_email_when_pin_has_changed
default_scope where(:state => 'active').order(:start)
@@ -55,7 +55,7 @@ class Conference < ActiveRecord::Base
end
def send_pin_email_when_pin_has_changed
- if self.conferenceable.class == User && self.pin_changed?
+ if !self.new_record? && self.conferenceable.class == User && self.pin_changed?
Notifications.new_pin(self).deliver
end
end
diff --git a/app/models/sip_account.rb b/app/models/sip_account.rb
index 2040b41..5660e37 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}@%'" }
+ 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}@%'" }
# Delegations:
#