class PactBroker::Api::Decorators::PacticipantDecorator
Public Class Methods
Source
# File lib/pact_broker/api/decorators/pacticipant_decorator.rb, line 30 def self.eager_load_associations [:labels, :latest_version] end
The associations that should be eager loaded on the Pacticipant so that this decorator can be used without any extra calls to the database. @return Array<Symbol>
Public Instance Methods
Source
# File lib/pact_broker/api/decorators/pacticipant_decorator.rb, line 131 def to_hash(options) h = super dasherized = DasherizedVersionDecorator.new(represented).to_hash(options) if dasherized["_embedded"] if dasherized["_embedded"]["latest-version"] dasherized["_embedded"]["latest-version"]["title"] = "DEPRECATED - please use latestVersion" dasherized["_embedded"]["latest-version"]["name"] = "DEPRECATED - please use latestVersion" end h["_embedded"] ||= {} h["_embedded"].merge!(dasherized["_embedded"]) end h end
representable passes through the kwargs from to_json as normal args
Calls superclass method