holderdeord/hdo-site

View on GitHub
app/representers/api/parties_representer.rb

Summary

Maintainability
A
20 mins
Test Coverage
module Api
  class PartiesRepresenter < PagedRepresenter
    link :find do
      {
        href: templated_url(:api_party_url, id: 'slug'),
        templated: true
      }
    end

    collection :to_a,
      embedded: true,
      name: :parties,
      as: :parties,
      extend: PartyRepresenter

    alias_method :url_helper, :api_parties_url

  end
end