Skip to content

Commit 18e01f4

Browse files
committed
Fix CI failures: route presenter options logic and domain V2 serialization
Route presenter: preserve original behavior where options: {} is included for routes with empty options, but omit options when all keys are internal-only (access_scope, access_rules). Domain model: remove enforce_access_rules and access_rules_scope from V2 export/import_attributes — these are V3-only fields exposed through the domain presenter, not the legacy V2 API.
1 parent 1a37cf6 commit 18e01f4

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

app/models/runtime/domain.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def shared_or_owned_by(organization_ids)
7979
one_to_many :labels, class: 'VCAP::CloudController::DomainLabelModel', key: :resource_guid, primary_key: :guid
8080
one_to_many :annotations, class: 'VCAP::CloudController::DomainAnnotationModel', key: :resource_guid, primary_key: :guid
8181

82-
export_attributes :name, :owning_organization_guid, :shared_organizations, :enforce_access_rules, :access_rules_scope
83-
import_attributes :name, :owning_organization_guid, :enforce_access_rules, :access_rules_scope
82+
export_attributes :name, :owning_organization_guid, :shared_organizations
83+
import_attributes :name, :owning_organization_guid
8484
strip_attributes :name
8585

8686
add_association_dependencies labels: :destroy

app/presenters/v3/route_presenter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def to_hash
5050
}
5151
unless route.options.nil?
5252
public_options = route.options.reject { |k, _| INTERNAL_ROUTE_OPTIONS.include?(k.to_s) }
53-
hash.merge!(options: public_options)
53+
hash.merge!(options: public_options) if route.options.empty? || public_options.present?
5454
end
5555

5656
@decorators.reduce(hash) { |memo, d| d.decorate(memo, [route]) }

0 commit comments

Comments
 (0)