holderdeord/hdo-site

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

Summary

Maintainability
A
0 mins
Test Coverage
module Api
  class ParliamentIssueRepresenter < BaseRepresenter
    property :last_update
    property :summary
    property :description
    property :status_name

    link :self do
      api_parliament_issue_url represented
    end

    links :votes do
      represented.votes.map do |p|
        {
          title: p.subject,
          href: api_vote_url(p)
        }
      end
    end

  end
end