Skip to content

Commit

Permalink
Run rubocop -a with current config
Browse files Browse the repository at this point in the history
  • Loading branch information
cycomachead committed Feb 13, 2024
1 parent f4e3ca2 commit 1dc8169
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def verify_user_admin
:any) || (current_user.has_cached_role? :organization_admin, :any) ||
(current_user.has_cached_role? :volunteers_coordinator, :any) ||
(current_user.has_cached_role? :track_organizer, :any) || current_user.is_admin
raise CanCan::AccessDenied, 'You are not authorized to access this page.'
raise CanCan::AccessDenied.new('You are not authorized to access this page.')
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def current_ability
end

def not_found
raise ActionController::RoutingError, 'Not Found'
raise ActionController::RoutingError.new('Not Found')
end

skip_authorization_check only: :apple_pay
Expand Down
6 changes: 2 additions & 4 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,10 @@ def get_logo(object)
# Timestamps are stored at UTC but in the real timezone.
# We must convert then shift the time back to get the correct value.
# TODO: just take in an object?
def inyourtz(time, timezone, &block)
def inyourtz(time, timezone, &)
time = time.in_time_zone(timezone)
time -= time.utc_offset
link_to "https://inyourtime.zone/t?#{time.to_i}", target: '_blank', rel: 'noopener' do
block.call
end
link_to("https://inyourtime.zone/t?#{time.to_i}", target: '_blank', rel: 'noopener', &)
end

def visible_conference_links
Expand Down
4 changes: 2 additions & 2 deletions app/models/program.rb
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ def check_languages_format
errors.add(:languages, "can't be repeated") && return unless languages_array.uniq!.nil?

# We check if every language is a valid ISO 639-1 language
errors.add(:languages, 'must be ISO 639-1 valid codes') unless languages_array.select do |x|
errors.add(:languages, 'must be ISO 639-1 valid codes') unless languages_array.none? do |x|
ISO_639.find(x).nil?
end.empty?
end
end

##
Expand Down
4 changes: 2 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def biography_limit
errors.add(:biography, 'is limited to 200 words.') if biography.present? && (biography.split.length > 200)
end

def send_devise_notification(notification, *args)
devise_mailer.send(notification, self, *args).deliver_later
def send_devise_notification(notification, *)
devise_mailer.send(notification, self, *).deliver_later
end
end
1 change: 1 addition & 0 deletions app/models/venue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def address
# TODO-SNAPCON: (mb) Fix this to use the country shortname?
def country_name
return unless country

I18nData.countries[country]
end

Expand Down
2 changes: 1 addition & 1 deletion spec/features/omniauth_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper'

describe Openid, type: :feature, js: true do
describe Openid, js: true, type: :feature do
shared_examples 'sign in with openid' do
it 'has option to log in with Google account' do
visit '/accounts/sign_in'
Expand Down

0 comments on commit 1dc8169

Please sign in to comment.