- def check_if_updated
- if @issue.reportable and (@issue.ignored? or @issue.resolved?) and @issue.reportable.updated_at > @last_report.updated_at
- return true
- else
- return false
- end
- end
-
- def get_report_details
- details = params[:report][:details] + "--||--"
- details = details + params[:report_type].to_s + "--||--"
- return details
- end
-
- def check_report_params
- if params[:report] and params[:report][:details] and params[:report_type]
- return true
- end
- return false
- end
-
- def find_issue
- @issue = Issue.find(params[:id])
- end
-
- def check_permission
- unless @user.administrator? or @user.moderator?
- flash[:error] = t('application.require_admin.not_an_admin')
- redirect_to root_path
- end
- end
-
- def create_new_issue_params
- params.permit(:reportable_id, :reportable_type, :reported_user_id)
- end
-
- def issue_params
- params[:issue].permit(:reportable_id, :reportable_type,:reported_user_id)
- end
-
- def report_params
- params[:report].permit(:details)
- end
-
- def issue_comment_params
- params.require(:issue_comment).permit(:body)
- end
-
+ def find_issue
+ @issue = Issue.visible_to(current_user).find(params[:id])
+ rescue ActiveRecord::RecordNotFound
+ redirect_to :controller => "errors", :action => "not_found"
+ end