Send messages only to users which have not been deleted
This commit is contained in:
parent
504c8b6192
commit
d48eecd6fe
1 changed files with 1 additions and 1 deletions
|
@ -35,7 +35,7 @@ class Message < ActiveRecord::Base
|
||||||
def clean_up_recipient_ids
|
def clean_up_recipient_ids
|
||||||
add_recipients Group.find(group_id).users unless group_id.blank?
|
add_recipients Group.find(group_id).users unless group_id.blank?
|
||||||
self.recipients_ids = recipients_ids.uniq.reject { |id| id.blank? } unless recipients_ids.nil?
|
self.recipients_ids = recipients_ids.uniq.reject { |id| id.blank? } unless recipients_ids.nil?
|
||||||
self.recipients_ids = User.all.collect(&:id) if send_to_all == "1"
|
self.recipients_ids = User.undeleted.collect(&:id) if send_to_all == "1"
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_recipients(users)
|
def add_recipients(users)
|
||||||
|
|
Loading…
Reference in a new issue