- def find_issue
- @issue = Issue.find(params[:id])
- end
-
- def check_permission
- unless @user.administrator?
- 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, :user_id)
- end
-
- def issue_params
- params[:issue].permit(:reportable_id, :reportable_type,:user_id)
- end
-
- def report_params
- params[:report].permit(:details)
- end
-
- def issue_comment_params
- params.require(:issue_comment).permit(:body, :user_id)
- end
+ def find_issue
+ @issue = Issue.visible_to(current_user).find(params[:id])
+ rescue ActiveRecord::RecordNotFound
+ redirect_to :controller => "errors", :action => "not_found"
+ end