Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 1 addition & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ inherit_mode:

plugins:
- rubocop-capybara
- rubocop-factory_bot
- rubocop-performance
- rubocop-rails
- rubocop-rake
- rubocop-rspec
- rubocop-rspec_rails

require:
- rubocop-factory_bot

AllCops:
NewCops: enable
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ group :development do
gem 'listen', '~> 3.9'
gem 'rails_best_practices', '~> 1.20'
gem 'reek', '~> 6.5'
gem 'rubocop', '~> 1.78', require: false
gem 'rubocop', '~> 1.80', require: false
gem 'rubocop-capybara', '~> 2.22'
gem 'rubocop-factory_bot', '~> 2.27', require: false
gem 'rubocop-performance', '~> 1.26', require: false
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -536,15 +536,15 @@ GEM
rswag-ui (2.16.0)
actionpack (>= 5.2, < 8.1)
railties (>= 5.2, < 8.1)
rubocop (1.78.0)
rubocop (1.80.2)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.45.1, < 2.0)
rubocop-ast (>= 1.46.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.46.0)
Expand Down Expand Up @@ -697,7 +697,7 @@ DEPENDENCIES
rspec-retry!
rswag-api (~> 2.16.0)
rswag-ui (~> 2.16.0)
rubocop (~> 1.78)
rubocop (~> 1.80)
rubocop-capybara (~> 2.22)
rubocop-factory_bot (~> 2.27)
rubocop-performance (~> 1.26)
Expand Down
1 change: 1 addition & 0 deletions app/controllers/api/v1/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module API
module V1
class PasswordsController < DeviseTokenAuth::PasswordsController
include API::Concerns::ActAsAPIRequest

protect_from_forgery with: :null_session

private
Expand Down
1 change: 1 addition & 0 deletions app/controllers/api/v1/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module API
module V1
class RegistrationsController < DeviseTokenAuth::RegistrationsController
include API::Concerns::ActAsAPIRequest

protect_from_forgery with: :null_session

private
Expand Down
1 change: 1 addition & 0 deletions app/controllers/api/v1/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module API
module V1
class SessionsController < DeviseTokenAuth::SessionsController
include API::Concerns::ActAsAPIRequest

protect_from_forgery with: :null_session

private
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/ransackable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Ransackable

class_methods do
def ransackable_attributes(auth_object = nil)
return (column_names + ransackers.keys) if auth_object == :admin
return column_names + ransackers.keys if auth_object == :admin

const_defined?(:RANSACK_ATTRIBUTES) ? self::RANSACK_ATTRIBUTES : []
end
Expand Down
4 changes: 1 addition & 3 deletions app/objects/impersonation/authenticator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def data
end

def user
@user ||= User.find(data['user_id']).tap do |it|
it.impersonated_by = admin_user_id
end
@user ||= User.find(data['user_id']).tap { it.impersonated_by = admin_user_id }
end

def admin_user_id
Expand Down
1 change: 1 addition & 0 deletions spec/requests/api/v1/concerns/impersonation/hooks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
before do
stub_const('FakeController', Class.new(API::V1::APIController) do
include API::Concerns::Impersonation::Hooks

skip_after_action :verify_authorized

def show
Expand Down