Quick correction to only send an email if a submitter email is present
This commit is contained in:
parent
b4c4e28165
commit
845e0d0983
@ -27,17 +27,19 @@ class Orga < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
after_update do
|
after_update do
|
||||||
send_secret if secret_changed? && submitter
|
if submitter
|
||||||
|
send_secret if secret_changed?
|
||||||
|
|
||||||
if moderated_changed?
|
if moderated_changed?
|
||||||
OrgaMailer.accept(self).deliver_now!
|
OrgaMailer.accept(self).deliver_now!
|
||||||
else
|
else
|
||||||
OrgaMailer.update(self).deliver_now!
|
OrgaMailer.update(self).deliver_now!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
before_destroy do
|
before_destroy do
|
||||||
OrgaMailer.destroy(self).deliver_now!
|
OrgaMailer.destroy(self).deliver_now! if submitter
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_secret
|
def send_secret
|
||||||
|
Loading…
Reference in New Issue
Block a user