Class: Decidim::Maintenance::ImportModels::AssemblyType
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::Maintenance::ImportModels::AssemblyType
- Defined in:
- decidim-core/lib/decidim/maintenance/import_models/assembly_type.rb
Direct Known Subclasses
Class Method Summary collapse
- .all_filters ⇒ Object
- .all_taxonomies ⇒ Object
- .participatory_space_manifests ⇒ Object
- .root_taxonomy_name ⇒ Object
Instance Method Summary collapse
Class Method Details
.all_filters ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'decidim-core/lib/decidim/maintenance/import_models/assembly_type.rb', line 36 def self.all_filters [ { name: root_taxonomy_name, participatory_space_manifests:, items: all_in_org.map { |type| [type.name[I18n.locale.to_s]] }, components: [] } ] end |
.all_taxonomies ⇒ Object
32 33 34 |
# File 'decidim-core/lib/decidim/maintenance/import_models/assembly_type.rb', line 32 def self.all_taxonomies all_in_org.to_h { |type| [type.name[I18n.locale.to_s], type.taxonomies] } end |
.participatory_space_manifests ⇒ Object
11 |
# File 'decidim-core/lib/decidim/maintenance/import_models/assembly_type.rb', line 11 def self.participatory_space_manifests = ["assemblies"] |
.root_taxonomy_name ⇒ Object
9 |
# File 'decidim-core/lib/decidim/maintenance/import_models/assembly_type.rb', line 9 def self.root_taxonomy_name = "~ #{I18n.t("decidim.admin.titles.assemblies_types")}" |
Instance Method Details
#name ⇒ Object
13 14 15 |
# File 'decidim-core/lib/decidim/maintenance/import_models/assembly_type.rb', line 13 def name title end |
#resources ⇒ Object
26 27 28 29 30 |
# File 'decidim-core/lib/decidim/maintenance/import_models/assembly_type.rb', line 26 def resources Decidim::Assembly.where(decidim_assemblies_type_id: id).to_h do |process| [process.to_global_id.to_s, process.title[I18n.locale.to_s]] end end |
#taxonomies ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'decidim-core/lib/decidim/maintenance/import_models/assembly_type.rb', line 17 def taxonomies { name:, origin: to_global_id.to_s, children: {}, resources: } end |