lib/billit_representers/models/bill.rb in billit_representers-0.8.0 vs lib/billit_representers/models/bill.rb in billit_representers-0.8.1
- old
+ new
@@ -9,16 +9,18 @@
require 'billit_representers/representers/priority_representer'
require 'billit_representers/representers/report_representer'
require 'billit_representers/representers/document_representer'
require 'billit_representers/representers/directive_representer'
require 'billit_representers/representers/remark_representer'
+require 'billit_representers/representers/revision_representer'
require 'billit_representers/models/paperwork'
require 'billit_representers/models/priority'
require 'billit_representers/models/report'
require 'billit_representers/models/document'
require 'billit_representers/models/directive'
require 'billit_representers/models/remark'
+require 'billit_representers/models/revision'
module Billit
class Bill
include Roar::Representer::JSON::HAL
include Roar::Representer::Feature::HttpVerbs
@@ -31,11 +33,10 @@
# validates :stage, inclusion: { in: @@stage_valid_values }
# validates :initial_chamber, inclusion: { in: @@initial_chamber_valid_values }
# validates :current_priority, inclusion: { in: @@current_priority_valid_values }
def initialize
- # extend Billit::BillRepresenter
extend Roar::Representer::Feature::Client
super
end
property :uid
@@ -53,17 +54,18 @@
property :subject_areas
property :authors
property :publish_date
property :abstract
property :tags
- property :revisions
+ property :bill_draft_link
collection :paperworks, extend: PaperworkRepresenter, class: Billit::Paperwork
collection :priorities, extend: PriorityRepresenter, class: Billit::Priority
collection :reports, extend: ReportRepresenter, class: Billit::Report
collection :documents, extend: DocumentRepresenter, class: Billit::Document
collection :directives, extend: DirectiveRepresenter, class: Billit::Directive
collection :remarks, extend: RemarkRepresenter, class: Billit::Remark
+ collection :revisions, extend: RevisionRepresenter, class: Billit::Revision
link :self do
bill_url(self.uid)
end
\ No newline at end of file