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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions app/fetchers/app_list_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/fetchers/queries/app_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/models/runtime/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down
12 changes: 6 additions & 6 deletions app/models/runtime/route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 7 additions & 7 deletions app/models/runtime/space.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion middleware/cors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/models/runtime/pollable_job_model_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down