Fix rubocop offenses after bundle update
This commit is contained in:
@ -81,7 +81,6 @@ class CommentsController < ApplicationController
|
|||||||
comment_params.except :request_id
|
comment_params.except :request_id
|
||||||
end
|
end
|
||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
|
||||||
def comment_params
|
def comment_params
|
||||||
# params.require(:comment).permit(:user_id, :file_id, :row, :column, :text)
|
# params.require(:comment).permit(:user_id, :file_id, :row, :column, :text)
|
||||||
# fuer production mode, damit böse menschen keine falsche user_id uebergeben:
|
# fuer production mode, damit böse menschen keine falsche user_id uebergeben:
|
||||||
|
@ -89,7 +89,6 @@ class ErrorTemplateAttributesController < ApplicationController
|
|||||||
@error_template_attribute = ErrorTemplateAttribute.find(params[:id])
|
@error_template_attribute = ErrorTemplateAttribute.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
|
||||||
def error_template_attribute_params
|
def error_template_attribute_params
|
||||||
if params[:error_template_attribute].present?
|
if params[:error_template_attribute].present?
|
||||||
params[:error_template_attribute].permit(:key, :description, :regex,
|
params[:error_template_attribute].permit(:key, :description, :regex,
|
||||||
|
@ -100,7 +100,6 @@ class ErrorTemplatesController < ApplicationController
|
|||||||
@error_template = ErrorTemplate.find(params[:id])
|
@error_template = ErrorTemplate.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
|
||||||
def error_template_params
|
def error_template_params
|
||||||
if params[:error_template].present?
|
if params[:error_template].present?
|
||||||
params[:error_template].permit(:name, :execution_environment_id, :signature, :description,
|
params[:error_template].permit(:name, :execution_environment_id, :signature, :description,
|
||||||
|
@ -90,7 +90,6 @@ class FileTemplatesController < ApplicationController
|
|||||||
@file_template = FileTemplate.find(params[:id])
|
@file_template = FileTemplate.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
|
||||||
def file_template_params
|
def file_template_params
|
||||||
params[:file_template].permit(:name, :file_type_id, :content) if params[:file_template].present?
|
params[:file_template].permit(:name, :file_type_id, :content) if params[:file_template].present?
|
||||||
end
|
end
|
||||||
|
@ -141,7 +141,6 @@ class RequestForCommentsController < ApplicationController
|
|||||||
@request_for_comment = RequestForComment.find(params[:id])
|
@request_for_comment = RequestForComment.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
|
||||||
def request_for_comment_params
|
def request_for_comment_params
|
||||||
# The study_group_id might not be present in the session (e.g. for internal users), resulting in session[:study_group_id] = nil which is intended.
|
# The study_group_id might not be present in the session (e.g. for internal users), resulting in session[:study_group_id] = nil which is intended.
|
||||||
params.require(:request_for_comment).permit(:exercise_id, :file_id, :question, :requested_at, :solved, :submission_id).merge(
|
params.require(:request_for_comment).permit(:exercise_id, :file_id, :question, :requested_at, :solved, :submission_id).merge(
|
||||||
|
@ -165,9 +165,9 @@ module StatisticsHelper
|
|||||||
key: 'rfcs_with_comments',
|
key: 'rfcs_with_comments',
|
||||||
name: t('statistics.entries.request_for_comments.with_comments'),
|
name: t('statistics.entries.request_for_comments.with_comments'),
|
||||||
data: RequestForComment.in_range(from,
|
data: RequestForComment.in_range(from,
|
||||||
to).joins('join "submissions" s on s.id = request_for_comments.submission_id
|
to).joins('join "submissions" s on s.id = request_for_comments.submission_id ' \
|
||||||
join "files" f on f.context_id = s.id and f.context_type = \'Submission\'
|
'join "files" f on f.context_id = s.id and f.context_type = \'Submission\' ' \
|
||||||
join "comments" c on c.file_id = f.id').group('request_for_comments.id').count.size,
|
'join "comments" c on c.file_id = f.id').group('request_for_comments.id').count.size,
|
||||||
url: statistics_graphs_path,
|
url: statistics_graphs_path,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -81,9 +81,9 @@ class RequestForComment < ApplicationRecord
|
|||||||
|
|
||||||
class << self
|
class << self
|
||||||
def with_last_activity
|
def with_last_activity
|
||||||
joins('join "submissions" s on s.id = request_for_comments.submission_id
|
joins('join "submissions" s on s.id = request_for_comments.submission_id ' \
|
||||||
left outer join "files" f on f.context_id = s.id
|
'left outer join "files" f on f.context_id = s.id ' \
|
||||||
left outer join "comments" c on c.file_id = f.id')
|
'left outer join "comments" c on c.file_id = f.id')
|
||||||
.group('request_for_comments.id')
|
.group('request_for_comments.id')
|
||||||
.select('request_for_comments.*, max(c.updated_at) as last_comment')
|
.select('request_for_comments.*, max(c.updated_at) as last_comment')
|
||||||
end
|
end
|
||||||
@ -91,10 +91,10 @@ class RequestForComment < ApplicationRecord
|
|||||||
def last_per_user(count = 5)
|
def last_per_user(count = 5)
|
||||||
from("(#{row_number_user_sql}) as request_for_comments")
|
from("(#{row_number_user_sql}) as request_for_comments")
|
||||||
.where('row_number <= ?', count)
|
.where('row_number <= ?', count)
|
||||||
.group('request_for_comments.id, request_for_comments.user_id, request_for_comments.user_type,
|
.group('request_for_comments.id, request_for_comments.user_id, request_for_comments.user_type, ' \
|
||||||
request_for_comments.exercise_id, request_for_comments.file_id, request_for_comments.question,
|
'request_for_comments.exercise_id, request_for_comments.file_id, request_for_comments.question, ' \
|
||||||
request_for_comments.created_at, request_for_comments.updated_at, request_for_comments.solved,
|
'request_for_comments.created_at, request_for_comments.updated_at, request_for_comments.solved, ' \
|
||||||
request_for_comments.full_score_reached, request_for_comments.submission_id, request_for_comments.row_number')
|
'request_for_comments.full_score_reached, request_for_comments.submission_id, request_for_comments.row_number')
|
||||||
# ugly, but necessary
|
# ugly, but necessary
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ require 'active_support/core_ext/integer/time'
|
|||||||
Rails.application.configure do
|
Rails.application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb.
|
# Settings specified here will take precedence over those in config/application.rb.
|
||||||
|
|
||||||
config.web_console.whitelisted_ips = '192.168.0.0/16'
|
config.web_console.allowed_ips = '192.168.0.0/16'
|
||||||
|
|
||||||
# In the development environment your application's code is reloaded any time
|
# In the development environment your application's code is reloaded any time
|
||||||
# it changes. This slows down response time but is perfect for development
|
# it changes. This slows down response time but is perfect for development
|
||||||
|
@ -19,9 +19,11 @@ Rails.application.configure do
|
|||||||
config.consider_all_requests_local = false
|
config.consider_all_requests_local = false
|
||||||
config.action_controller.perform_caching = true
|
config.action_controller.perform_caching = true
|
||||||
|
|
||||||
|
# rubocop:disable Naming/InclusiveLanguage
|
||||||
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
|
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
|
||||||
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
|
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
|
||||||
# config.require_master_key = true
|
# config.require_master_key = true
|
||||||
|
# rubocop:enable Naming/InclusiveLanguage
|
||||||
|
|
||||||
# Disable serving static files from the `/public` folder by default since
|
# Disable serving static files from the `/public` folder by default since
|
||||||
# Apache or NGINX already handles this.
|
# Apache or NGINX already handles this.
|
||||||
|
Reference in New Issue
Block a user