Class: Decidim::Proposals::ProposalType

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

Instance Method Summary collapse

Instance Method Details

#coordinatesObject



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

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

#meetingObject



48
49
50
# File 'lib/decidim/api/proposal_type.rb', line 48

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

#vote_countObject



54
55
56
57
# File 'lib/decidim/api/proposal_type.rb', line 54

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