Skip to content

Commit

Permalink
Merge pull request #3207 from americodls/upgrade-rubocop-rails-and-fi…
Browse files Browse the repository at this point in the history
…x-issues

Bump rubocop-rails from 2.15.2 to 2.16.0 and fix issues
  • Loading branch information
simi committed Sep 12, 2022
2 parents 3cc8bb1 + 4ed828c commit 5b434b6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ group :development, :test do

gem "brakeman", require: false
gem "rubocop", "~> 1.23", require: false
gem "rubocop-rails", "~> 2.12", require: false
gem "rubocop-rails", "~> 2.16", require: false
gem "rubocop-performance", "~> 1.12", require: false
gem "rubocop-minitest", "~> 0.16", require: false
end
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,10 @@ GEM
rubocop-performance (1.14.3)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.15.2)
rubocop-rails (2.16.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
rubocop (>= 1.33.0, < 2.0)
ruby-graphviz (1.2.5)
rexml
ruby-progressbar (1.11.0)
Expand Down Expand Up @@ -521,7 +521,7 @@ DEPENDENCIES
rubocop (~> 1.23)
rubocop-minitest (~> 0.16)
rubocop-performance (~> 1.12)
rubocop-rails (~> 2.12)
rubocop-rails (~> 2.16)
sassc-rails
selenium-webdriver
shoryuken (~> 4.0)
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/api_keys_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def create
@api_key = ApiKey.new(build_params)

if @api_key.errors.present?
flash[:error] = @api_key.errors.full_messages.to_sentence
flash.now[:error] = @api_key.errors.full_messages.to_sentence
@api_key = current_user.api_keys.build(api_key_params.merge(rubygem_id: nil))
return render :new
end
Expand All @@ -32,7 +32,7 @@ def create
session[:api_key] = key
redirect_to profile_api_keys_path, flash: { notice: t(".success") }
else
flash[:error] = @api_key.errors.full_messages.to_sentence
flash.now[:error] = @api_key.errors.full_messages.to_sentence
render :new
end
end
Expand All @@ -50,14 +50,14 @@ def update
@api_key.assign_attributes(api_key_params)

if @api_key.errors.present?
flash[:error] = @api_key.errors.full_messages.to_sentence
flash.now[:error] = @api_key.errors.full_messages.to_sentence
return render :edit
end

if @api_key.save
redirect_to profile_api_keys_path, flash: { notice: t(".success") }
else
flash[:error] = @api_key.errors.full_messages.to_sentence
flash.now[:error] = @api_key.errors.full_messages.to_sentence
render :edit
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/multifactor_auths_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def create
flash[:error] = current_user.errors[:base].join
redirect_to edit_settings_url
else
flash[:success] = t(".success")
flash.now[:success] = t(".success")
@continue_path = session.fetch("mfa_redirect_uri", edit_settings_path)
session.delete("mfa_redirect_uri")
render :recovery
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/owners_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def notify_owner_added(ownership)

def index_with_error(msg, status)
@ownerships = @rubygem.ownerships_including_unconfirmed.includes(:user, :authorizer)
flash[:alert] = msg
flash.now[:alert] = msg
render :index, status: status
end

Expand Down

0 comments on commit 5b434b6

Please sign in to comment.