Skip to content

Commit

Permalink
docs: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Nov 24, 2023
1 parent a110dd1 commit 2f3eb3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/pact_broker/api/decorators/version_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class VersionDecorator < BaseDecorator
{
title: "Version",
name: represented.number,
# This decorator is used for multiple Version resources, so dynamically fetch the current resource URL
href: options.fetch(:resource_url)
}
end
Expand Down
6 changes: 2 additions & 4 deletions lib/pact_broker/api/decorators/versions_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ module PactBroker
module Api
module Decorators
class VersionsDecorator < BaseDecorator

class VersionInCollectionDecorator < PactBroker::Api::Decorators::VersionDecorator

# VersionDecorator has a dynamic self URL, depending which path the Version resource is mounted at
# Hardcode the URL of the Versions in the collection to the URL with the number.
# VersionDecorator has a dynamic self URL, depending which path the Version resource is mounted at.
# Hardcode the URL of the embedded Versions in this collection to use the canonical URL with the version number.
link :self do | user_options |
{
title: "Version",
Expand Down

0 comments on commit 2f3eb3c

Please sign in to comment.