if !@issue
@issue = Issue.find_or_initialize_by(issue_params)
@issue.updated_by = nil
- @admins = UserRole.where(role: "administrator")
- @admins.each do |admin|
- Notifier.new_issue_notification(User.find(admin.user_id)).deliver_now
- end
# Reassign to moderators if it is a moderator issue
@issue.issue_type = "administrator"
if moderator_issues.include? @issue.reportable.class.name
reassign_issue
end
+
+ @admins_or_mods = UserRole.where(role: @issue.issue_type)
+ @admins_or_mods.each do |user|
+ Notifier.new_issue_notification(User.find(user.user_id)).deliver_now
+ end
+
end
# Check if details provided are sufficient
<% end %>
</li>
<li>
- <%= link_to t('user.view.report'), new_issue_url(reportable_id: @this_user.id, reportable_type: @this_user.class.name) %>
+ <%= link_to t('user.view.report'), new_issue_url(reportable_id: @this_user.id, reportable_type: @this_user.class.name, reported_user_id: @this_user.id) %>
</li>
<% if @this_user.blocks.exists? %>
<li>