- # TODO: Find better place to add these
- admin_issues = [ 'DiaryEntry', 'DiaryComment', 'User']
- moderator_issues = [ 'Changeset' ]
-
-
- @issue = Issue.find_by_reportable_id_and_reportable_type(params[:reportable_id],params[:reportable_type])
- # Check if Issue alrwady exists
- 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
+ # If last_updated_by
+ if params[:last_updated_by] && params[:last_updated_by][0].present?
+ last_updated_by = params[:last_updated_by][0].to_s == "nil" ? nil : params[:last_updated_by][0].to_i
+ @issues = @issues.where(:updated_by => last_updated_by)