summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-27 20:27:24 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-27 20:27:24 +0100
commit30dffaac93c96edb5ba0100cbbdf62f5691d07f5 (patch)
tree2ee71d71807c8e710a200964186b4a6f990ca2df /app/models
parent5341d680be8c7701f97cd497015da37806046f03 (diff)
Don't send a PIN e-mail for a just created conference.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/conference.rb4
1 files changed, 2 insertions, 2 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