Sha256: 7c9d71a69f9d3de3d6ac93debca48762f219b817dcfe4e1dad39cf05f7baceb0

Contents?: true

Size: 814 Bytes

Versions: 19

Compression:

Stored size: 814 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # Area types allows to use different types of areas in participatory space
  # (terriotrial, sectorial, etc.)
  class AreaType < ApplicationRecord
    include Decidim::TranslatableResource
    include Decidim::Traceable

    translatable_fields :name, :plural

    belongs_to :organization,
               foreign_key: "decidim_organization_id",
               class_name: "Decidim::Organization",
               inverse_of: :area_types

    has_many :areas, class_name: "Decidim::Area", inverse_of: :area_type, dependent: :nullify

    validates :name, presence: true

    def translated_name
      Decidim::AreaTypePresenter.new(self).translated_name
    end

    def self.log_presenter_class_for(_log)
      Decidim::AdminLog::AreaTypePresenter
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
decidim-core-0.28.4 app/models/decidim/area_type.rb
decidim-core-0.27.9 app/models/decidim/area_type.rb
decidim-core-0.28.3 app/models/decidim/area_type.rb
decidim-core-0.27.8 app/models/decidim/area_type.rb
decidim-core-0.28.2 app/models/decidim/area_type.rb
decidim-core-0.27.7 app/models/decidim/area_type.rb
decidim-core-0.28.1 app/models/decidim/area_type.rb
decidim-core-0.27.6 app/models/decidim/area_type.rb
decidim-core-0.28.0 app/models/decidim/area_type.rb
decidim-core-0.27.5 app/models/decidim/area_type.rb
decidim-core-0.28.0.rc5 app/models/decidim/area_type.rb
decidim-core-0.28.0.rc4 app/models/decidim/area_type.rb
decidim-core-0.27.4 app/models/decidim/area_type.rb
decidim-core-0.27.3 app/models/decidim/area_type.rb
decidim-core-0.27.2 app/models/decidim/area_type.rb
decidim-core-0.27.1 app/models/decidim/area_type.rb
decidim-core-0.27.0 app/models/decidim/area_type.rb
decidim-core-0.27.0.rc2 app/models/decidim/area_type.rb
decidim-core-0.27.0.rc1 app/models/decidim/area_type.rb