Fix Rubocop offense

This commit is contained in:
Sebastian Serth
2022-06-15 17:39:20 +02:00
parent aaa0772c95
commit 0a3b4a8129
3 changed files with 3 additions and 3 deletions

View File

@ -176,7 +176,7 @@ class ExercisesController < ApplicationController
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
exercise = ::ProformaService::Import.call(zip: tempfile, user: user) exercise = ::ProformaService::Import.call(zip: tempfile, user: user)
exercise.save! exercise.save!
return render json: {}, status: :created render json: {}, status: :created
end end
rescue Proforma::ExerciseNotOwned rescue Proforma::ExerciseNotOwned
render json: {}, status: :unauthorized render json: {}, status: :unauthorized

View File

@ -23,7 +23,7 @@ Rails.application.eager_load!
(ApplicationRecord.descendants - [ActiveRecord::SchemaMigration, User]).each(&:delete_all) (ApplicationRecord.descendants - [ActiveRecord::SchemaMigration, User]).each(&:delete_all)
# delete file uploads # delete file uploads
FileUtils.rm_rf(Rails.root.join('public/uploads')) FileUtils.rm_rf(Rails.public_path.join('uploads'))
# load environment-dependent seeds # load environment-dependent seeds
load(Rails.root.join("db/seeds/#{Rails.env}.rb")) load(Rails.root.join("db/seeds/#{Rails.env}.rb"))

View File

@ -11,7 +11,7 @@ describe FileUploader do
after { uploader.remove! } after { uploader.remove! }
it 'uses the specified storage directory' do it 'uses the specified storage directory' do
expect(uploader.file.path).to start_with(Rails.root.join('public', uploader.store_dir).to_s) expect(uploader.file.path).to start_with(Rails.public_path.join(uploader.store_dir).to_s)
expect(uploader.file.path).to end_with(file_path.basename.to_s) expect(uploader.file.path).to end_with(file_path.basename.to_s)
end end