diff --git a/Gemfile b/Gemfile index e7dffa5f72f..58f7dfa2843 100644 --- a/Gemfile +++ b/Gemfile @@ -79,7 +79,7 @@ group :test do gem 'rspec-its' gem 'rspec-rails', '~> 8.0.2' gem 'rspec-wait' - gem 'rubocop', '~> 1.84.0' + gem 'rubocop', '~> 1.84.1' gem 'rubocop-capybara' gem 'rubocop-factory_bot' gem 'rubocop-rails', '~> 2.34' diff --git a/Gemfile.lock b/Gemfile.lock index f9234801379..4785f1cb061 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -273,7 +273,7 @@ GEM rdoc (>= 4.0.0) reline (>= 0.4.2) jaro_winkler (1.6.1) - json (2.18.0) + json (2.18.1) json-diff (0.4.1) json-schema (6.1.0) addressable (~> 2.8) @@ -475,7 +475,7 @@ GEM activesupport (>= 3.0.0) mustache (~> 1.0, >= 0.99.4) rspec (~> 3.0) - rubocop (1.84.0) + rubocop (1.84.1) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -679,7 +679,7 @@ DEPENDENCIES rspec-rails (~> 8.0.2) rspec-wait rspec_api_documentation (>= 6.1.0) - rubocop (~> 1.84.0) + rubocop (~> 1.84.1) rubocop-capybara rubocop-factory_bot rubocop-rails (~> 2.34) diff --git a/app/fetchers/app_list_fetcher.rb b/app/fetchers/app_list_fetcher.rb index 9db86889a00..44ce19774c2 100644 --- a/app/fetchers/app_list_fetcher.rb +++ b/app/fetchers/app_list_fetcher.rb @@ -38,24 +38,24 @@ def filter(message, dataset) when BuildpackLifecycleDataModel::LIFECYCLE_TYPE dataset = dataset.where( guid: BuildpackLifecycleDataModel. - where(Sequel.~(app_guid: nil)). - select(:app_guid) + where(Sequel.~(app_guid: nil)). + select(:app_guid) ) when DockerLifecycleDataModel::LIFECYCLE_TYPE dataset = dataset.exclude( guid: BuildpackLifecycleDataModel. - where(Sequel.~(app_guid: nil)). - select(:app_guid) + where(Sequel.~(app_guid: nil)). + select(:app_guid) ).exclude( guid: CNBLifecycleDataModel. - where(Sequel.~(app_guid: nil)). - select(:app_guid) + where(Sequel.~(app_guid: nil)). + select(:app_guid) ) when CNBLifecycleDataModel::LIFECYCLE_TYPE dataset = dataset.where( guid: CNBLifecycleDataModel. - where(Sequel.~(app_guid: nil)). - select(:app_guid) + where(Sequel.~(app_guid: nil)). + select(:app_guid) ) end end diff --git a/app/fetchers/queries/app_query.rb b/app/fetchers/queries/app_query.rb index f3053898010..537de0411c1 100644 --- a/app/fetchers/queries/app_query.rb +++ b/app/fetchers/queries/app_query.rb @@ -28,8 +28,8 @@ def stack_filter(dataset, cond) dataset.where( app: VCAP::CloudController::AppModel.where( buildpack_lifecycle_data: VCAP::CloudController::BuildpackLifecycleDataModel.where(stack: stack_names). - exclude(app_guid: nil). - select(:guid) + exclude(app_guid: nil). + select(:guid) ).select(:guid) ) end diff --git a/app/models/runtime/organization.rb b/app/models/runtime/organization.rb index b2f43a0ff9c..226d7dda885 100644 --- a/app/models/runtime/organization.rb +++ b/app/models/runtime/organization.rb @@ -57,7 +57,7 @@ class Organization < Sequel::Model # r.qualified_right_key = :private_domain_id # r.predicate_key = :organization_id VCAP::CloudController::Domain.dataset.where(owning_organization_id: id). - or(id: db[r.join_table_source].select(r.qualified_right_key).where(r.predicate_key => id)) + or(id: db[r.join_table_source].select(r.qualified_right_key).where(r.predicate_key => id)) }, before_add: proc { |org, private_domain| org.cancel_action unless private_domain.addable_to_organization?(org) }, before_remove: proc { |org, private_domain| org.cancel_action if private_domain.owned_by?(org) }, diff --git a/app/models/runtime/route.rb b/app/models/runtime/route.rb index 1a54bd72b44..bdefff78c41 100644 --- a/app/models/runtime/route.rb +++ b/app/models/runtime/route.rb @@ -189,12 +189,12 @@ def validate_changed_space(new_space) def self.user_visibility_filter(user) { space_id: user.space_developer_space_ids. - union(user.space_manager_space_ids, from_self: false). - union(user.space_auditor_space_ids, from_self: false). - union(user.space_supporter_space_ids, from_self: false). - union(Space.join(user.org_manager_org_ids, organization_id: :organization_id).select(:spaces__id)). - union(Space.join(user.org_auditor_org_ids, organization_id: :organization_id).select(:spaces__id)). - select(:space_id) + union(user.space_manager_space_ids, from_self: false). + union(user.space_auditor_space_ids, from_self: false). + union(user.space_supporter_space_ids, from_self: false). + union(Space.join(user.org_manager_org_ids, organization_id: :organization_id).select(:spaces__id)). + union(Space.join(user.org_auditor_org_ids, organization_id: :organization_id).select(:spaces__id)). + select(:space_id) } end diff --git a/app/models/runtime/space.rb b/app/models/runtime/space.rb index de02068b544..18324a8be81 100644 --- a/app/models/runtime/space.rb +++ b/app/models/runtime/space.rb @@ -75,7 +75,7 @@ class DBNameUniqueRaceError < Sequel::ValidationFailed; end many_to_many :security_groups, dataset: lambda { SecurityGroup.left_join(:security_groups_spaces, security_group_id: :id). - where(Sequel.or(security_groups_spaces__space_id: id, security_groups__running_default: true)).distinct(:id) + where(Sequel.or(security_groups_spaces__space_id: id, security_groups__running_default: true)).distinct(:id) }, eager_loader: lambda { |spaces_map| space_ids = spaces_map[:id_map].keys @@ -99,7 +99,7 @@ class DBNameUniqueRaceError < Sequel::ValidationFailed; end right_key: :staging_security_group_id, dataset: lambda { SecurityGroup.left_join(:staging_security_groups_spaces, staging_security_group_id: :id). - where(Sequel.or(staging_security_groups_spaces__staging_space_id: id, security_groups__staging_default: true)).distinct(:id) + where(Sequel.or(staging_security_groups_spaces__staging_space_id: id, security_groups__staging_default: true)).distinct(:id) }, eager_loader: lambda { |spaces_map| space_ids = spaces_map[:id_map].keys @@ -277,11 +277,11 @@ def number_service_keys def self.user_visibility_filter(user) { spaces__id: user.space_developer_space_ids. - union(user.space_manager_space_ids, from_self: false). - union(user.space_auditor_space_ids, from_self: false). - union(user.space_supporter_space_ids, from_self: false). - union(dataset.join(user.org_manager_org_ids, organization_id: :organization_id).select(:spaces__id), from_self: false). - select(:space_id) + union(user.space_manager_space_ids, from_self: false). + union(user.space_auditor_space_ids, from_self: false). + union(user.space_supporter_space_ids, from_self: false). + union(dataset.join(user.org_manager_org_ids, organization_id: :organization_id).select(:spaces__id), from_self: false). + select(:space_id) } end diff --git a/middleware/cors.rb b/middleware/cors.rb index ee3125f292d..58834626291 100644 --- a/middleware/cors.rb +++ b/middleware/cors.rb @@ -29,7 +29,7 @@ def call(env) 'Access-Control-Allow-Methods' => 'GET,PUT,POST,DELETE', 'Access-Control-Max-Age' => '900', 'Access-Control-Allow-Headers' => Set.new(%w[origin content-type authorization]). - merge(env['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'].to_s.split(',').map(&:strip).map(&:downcase)).to_a.join(',') + merge(env['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'].to_s.split(',').map(&:strip).map(&:downcase)).to_a.join(',') }) end diff --git a/spec/unit/models/runtime/pollable_job_model_spec.rb b/spec/unit/models/runtime/pollable_job_model_spec.rb index c35058ef99f..4e34dbaed52 100644 --- a/spec/unit/models/runtime/pollable_job_model_spec.rb +++ b/spec/unit/models/runtime/pollable_job_model_spec.rb @@ -95,7 +95,7 @@ module VCAP::CloudController it 'returns true if the resource exists' do organization_quota = QuotaDefinition.make job = PollableJobModel.make(resource_type: 'organization_quota', resource_guid: organization_quota. - guid) + guid) expect(job.resource_exists?).to be(true) end