Sha256: ee1596fd506f8b3559fa63001e35f0594e12560fb007980914b12228369536ee

Contents?: true

Size: 880 Bytes

Versions: 9

Compression:

Stored size: 880 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module NavigationMaps
    # Abstract class from which all models in this engine inherit.
    class BlueprintArea < ApplicationRecord
      include Decidim::TranslatableAttributes

      self.table_name = "decidim_navigation_maps_blueprint_areas"

      belongs_to :blueprint, foreign_key: :decidim_navigation_maps_blueprint_id, class_name: "Decidim::NavigationMaps::Blueprint"

      attribute :link_type, :string, default: "link"

      validates :blueprint, presence: true

      def to_geoson
        {
          type: area_type,
          geometry: area,
          properties: {
            link: link,
            popup: link_type == "direct",
            color: color,
            title: translated_attribute(title),
            description: translated_attribute(description)
          }
        }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
decidim-navigation_maps-1.3.4 app/models/decidim/navigation_maps/blueprint_area.rb
decidim-navigation_maps-1.3.3 app/models/decidim/navigation_maps/blueprint_area.rb
decidim-navigation_maps-1.3.2 app/models/decidim/navigation_maps/blueprint_area.rb
decidim-navigation_maps-1.3.1 app/models/decidim/navigation_maps/blueprint_area.rb
decidim-navigation_maps-1.3.0 app/models/decidim/navigation_maps/blueprint_area.rb
decidim-navigation_maps-1.2.0 app/models/decidim/navigation_maps/blueprint_area.rb
decidim-navigation_maps-1.1.1 app/models/decidim/navigation_maps/blueprint_area.rb
decidim-navigation_maps-1.1.0 app/models/decidim/navigation_maps/blueprint_area.rb
decidim-navigation_maps-1.0.1 app/models/decidim/navigation_maps/blueprint_area.rb