Class: Decidim::TermCustomizer::Constraint

Inherits:
ApplicationRecord show all
Defined in:
app/models/decidim/term_customizer/constraint.rb

Instance Method Summary collapse

Instance Method Details

#componentObject



13
14
15
# File 'app/models/decidim/term_customizer/constraint.rb', line 13

def component
  subject if subject.is_a?(Decidim::Component)
end

#manifestObject



23
24
25
26
27
28
29
# File 'app/models/decidim/term_customizer/constraint.rb', line 23

def manifest
  space_class = space ? space.class.name : subject_type

  Decidim.participatory_space_manifests.find do |manifest|
    manifest.model_class_name == space_class
  end
end

#manifest_nameObject



31
32
33
# File 'app/models/decidim/term_customizer/constraint.rb', line 31

def manifest_name
  manifest.try(:name)
end

#spaceObject



17
18
19
20
21
# File 'app/models/decidim/term_customizer/constraint.rb', line 17

def space
  return component.participatory_space if component

  subject
end