Class: Decidim::Proposals::ProposalType

Inherits:
Api::Types::BaseObject show all
Defined in:
decidim-proposals/lib/decidim/api/proposal_type.rb

Instance Method Summary collapse

Instance Method Details

#coordinatesObject


26
27
28
# File 'decidim-proposals/lib/decidim/api/proposal_type.rb', line 26

def coordinates
  [object.latitude, object.longitude]
end

#meetingObject


44
45
46
# File 'decidim-proposals/lib/decidim/api/proposal_type.rb', line 44

def meeting
  object.authors.first if object.official_meeting?
end

#vote_countObject


50
51
52
53
# File 'decidim-proposals/lib/decidim/api/proposal_type.rb', line 50

def vote_count
  current_component = object.component
  object.proposal_votes_count unless current_component.current_settings.votes_hidden?
end