Sha256: b6631ddc86f52228ff711d2fd1d38be4132066ba2582a57b3773474b27fe8f1e
Contents?: true
Size: 615 Bytes
Versions: 13
Compression:
Stored size: 615 Bytes
Contents
# frozen_string_literal: true require "active_support/concern" require "decidim/feature_validator" module Decidim # A concern with the features needed when you want a model to have a feature. module HasFeature extend ActiveSupport::Concern included do belongs_to :feature, foreign_key: "decidim_feature_id", class_name: "Decidim::Feature" has_one :organization, through: :feature end class_methods do def feature_manifest_name(manifest_name) validates :feature, feature: { manifest: manifest_name || name.demodulize.pluralize.downcase } end end end end
Version data entries
13 entries across 13 versions & 2 rubygems