- 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] + "--||--"
- path = 'issues.report_strings.' + @issue.reportable.class.name.to_s
- @report_strings_yaml = t( path)
- @report_strings_yaml.each do |k,v|
- if params[k.to_sym]
- details = details + params[k.to_sym] + "--||--"
- end
- end
- return details
- end
-
- def check_report_params
- path = 'issues.report_strings.' + @issue.reportable.class.name.to_s
- @report_strings_yaml = t( path)
- if params[:report] and params[:report][:details]
- @report_strings_yaml.each do |k,v|
- if params[k.to_sym]
- return true
- end
- end
- end
- return false
- end
-
- 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, :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
-