Class: Decidim::ReportingProposals::ProposalForm

Inherits:
Proposals::ProposalForm
  • Object
show all
Defined in:
app/forms/decidim/reporting_proposals/proposal_form.rb

Instance Method Summary collapse

Instance Method Details

#has_address?Boolean



22
23
24
25
26
# File 'app/forms/decidim/reporting_proposals/proposal_form.rb', line 22

def has_address?
  return if has_no_address

  geocoding_enabled?
end

#has_camera?Boolean



28
29
30
31
32
# File 'app/forms/decidim/reporting_proposals/proposal_form.rb', line 28

def has_camera?
  return if has_no_image

  current_component.settings.attachments_allowed?
end

#map_model(model) ⇒ Object

Set the has no address



15
16
17
18
19
20
# File 'app/forms/decidim/reporting_proposals/proposal_form.rb', line 15

def map_model(model)
  super(model)

  self.has_no_address = true if model.address.blank?
  self.has_no_image = true if model.photo.blank?
end