Sha256: 415f4126bd150763b4b70e5d804148d04ae5b5472046845ec4b03ad57b8c0153
Contents?: true
Size: 656 Bytes
Versions: 16
Compression:
Stored size: 656 Bytes
Contents
# frozen_string_literal: true module Decidim # This concern contains the logic related to followable resources. module Followable extend ActiveSupport::Concern included do has_many :follows, as: :followable, foreign_key: "decidim_followable_id", foreign_type: "decidim_followable_type", class_name: "Decidim::Follow" has_many :followers, through: :follows, source: :user end def followers if respond_to?(:participatory_space) && participatory_space.present? && participatory_space.respond_to?(:followers) super.or(participatory_space.followers).distinct else super end end end end
Version data entries
16 entries across 16 versions & 1 rubygems