fix bug with UserMap notifications

This commit is contained in:
Devin Howard 2016-12-09 11:55:53 -05:00
parent 9865a1e063
commit 5eb6435543

View file

@ -36,8 +36,9 @@ class AccessController < ApplicationController
@map.add_new_collaborators(user_ids).each do |user_id|
# add_new_collaborators returns array of added users,
# who we then send an email to
mail = MapMailer.invite_to_edit_email(@map, current_user, User.find(user_id))
user.notify(mail.subject, 'invite to edit', UserMap.find_by(user_id: user_id, map: @map), true, MAILBOXER_CODE_INVITED_TO_EDIT)
user = User.find(user_id)
mail = MapMailer.invite_to_edit_email(@map, current_user, user)
user.notify(mail.subject, 'invite to edit', UserMap.find_by(user: user, map: @map), true, MAILBOXER_CODE_INVITED_TO_EDIT)
end
@map.remove_old_collaborators(user_ids)