Sha256: 049eba5fa4fe43181a09a7d67d35016d93426565994dafc2fd6960704367d1c1
Contents?: true
Size: 633 Bytes
Versions: 7
Compression:
Stored size: 633 Bytes
Contents
# frozen_string_literal: true module Decidim module Plans # A tag is a record that allows providing metadata for the items to be # tagged, i.e. the "taggables". In this context, only plans are taggable. class Tag < Plans::ApplicationRecord belongs_to :organization, foreign_key: "decidim_organization_id", class_name: "Decidim::Organization" has_many :plan_taggings, foreign_key: :decidim_plans_tag_id, dependent: :destroy validates :organization, presence: true def plan_taggings_count PlanTagging.where(tag: self).count end end end end
Version data entries
7 entries across 7 versions & 1 rubygems