Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump rubocop-rails from 2.27.0 to 2.28.0 in the rubocop group #6035

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ group :development do
gem 'rubocop-capybara', '~> 2.21.0'
gem 'rubocop-factory_bot', '~> 2.26'
gem 'rubocop-minitest', '~> 0.36.0'
gem 'rubocop-rails', '~> 2.27.0'
gem 'rubocop-rails', '~> 2.28.0'

# for opening letters
gem 'letter_opener', '~> 1.10.0'
Expand Down
28 changes: 15 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ GEM
bcrypt (3.1.20)
bcrypt_pbkdf (1.1.1)
benchmark (0.4.0)
bigdecimal (3.1.8)
bigdecimal (3.1.9)
bindata (2.5.0)
bindex (0.8.1)
bootsnap (1.18.4)
Expand Down Expand Up @@ -236,7 +236,7 @@ GEM
activesupport (>= 5.0.0)
jsbundling-rails (1.3.1)
railties (>= 6.0.0)
json (2.7.4)
json (2.9.1)
json-jwt (1.16.6)
activesupport (>= 4.2)
aes_key_wrap
Expand Down Expand Up @@ -267,7 +267,7 @@ GEM
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.3)
logger (1.6.4)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -355,7 +355,7 @@ GEM
orm_adapter (0.5.0)
ostruct (0.6.0)
parallel (1.26.3)
parser (3.3.5.0)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
premailer (1.18.0)
Expand Down Expand Up @@ -440,25 +440,25 @@ GEM
rb-readline (0.5.5)
rdoc (6.8.1)
psych (>= 4.0.0)
regexp_parser (2.9.2)
regexp_parser (2.10.0)
reline (0.5.11)
io-console (~> 0.5)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.9)
rouge (4.5.1)
rubocop (1.67.0)
rubocop (1.69.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
parser (>= 3.3.1.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
Expand All @@ -467,7 +467,7 @@ GEM
rubocop-minitest (0.36.0)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.27.0)
rubocop-rails (2.28.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
Expand Down Expand Up @@ -533,7 +533,9 @@ GEM
trilogy (2.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
unicode-display_width (3.1.3)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (0.13.1)
useragent (0.16.10)
validate_url (1.0.15)
Expand Down Expand Up @@ -633,7 +635,7 @@ DEPENDENCIES
rubocop-capybara (~> 2.21.0)
rubocop-factory_bot (~> 2.26)
rubocop-minitest (~> 0.36.0)
rubocop-rails (~> 2.27.0)
rubocop-rails (~> 2.28.0)
ruby-saml (~> 1.17.0)
rubyzip (~> 2.3.2)
selenium-webdriver (~> 4.27.0)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/activities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def update
if labels
labels = labels&.split(',') unless labels.is_a?(Array)
labels = (labels + (@activity.merged_dirconfig[:labels] || []))
attributes[:labels] = labels&.map(&:downcase)&.uniq&.map { |name| Label.find_by(name: name) || Label.create(name: name) }
attributes[:labels] = labels.map(&:downcase).uniq.map { |name| Label.find_by(name: name) || Label.create(name: name) } if labels
end

respond_to do |format|
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/course_members_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def update
course_labels = attributes[:course_labels]
if course_labels
course_labels = course_labels.split(',') unless course_labels.is_a?(Array)
attributes[:course_labels] = course_labels&.map(&:downcase)&.uniq&.map { |name| CourseLabel.find_by(course: @course, name: name) || CourseLabel.create(course: @course, name: name) }
attributes[:course_labels] = course_labels.map(&:downcase).uniq.map { |name| CourseLabel.find_by(course: @course, name: name) || CourseLabel.create(course: @course, name: name) } if course_labels
end

if @course_membership.update(attributes)
Expand Down
7 changes: 5 additions & 2 deletions app/policies/evaluation_exercise_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ def update?
private

def course_admin?
course = record&.evaluation&.series&.course
user&.course_admin?(course)
return false unless user
return false unless record

course = record.evaluation.series.course
user.course_admin?(course)
end
end
5 changes: 4 additions & 1 deletion app/policies/evaluation_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def permitted_attributes
private

def course_admin?
user&.course_admin?(record&.series&.course)
return false unless user
return false unless record

user.course_admin?(record.series.course)
end
end
5 changes: 4 additions & 1 deletion app/policies/feedback_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def permitted_attributes
private

def course_admin?
user&.course_admin?(record&.evaluation&.series&.course)
return false unless user
return false unless record

user.course_admin?(record.evaluation.series.course)
end
end
7 changes: 5 additions & 2 deletions app/policies/score_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ def permitted_attributes_for_update
private

def course_admin?
course = record&.feedback&.evaluation&.series&.course
user&.course_admin?(course)
return false unless user
return false unless record

course = record.feedback.evaluation.series.course
user.course_admin?(course)
end
end