Sha256: 66dbbb4a03c9de77f71f79f14257478486976eb9bae6c9685e826b7d90e07a27
Contents?: true
Size: 721 Bytes
Versions: 56
Compression:
Stored size: 721 Bytes
Contents
# frozen_string_literal: true module Decidim module Comments module Export # Public: Given a resource class and a feature, returns the comments for that # resource in that feature. # # resource_class - The resource's Class # feature - The feature where the resource is scoped to. # # Returns an Arel::Relation with all the comments for that feature and resource. def comments_for_resource(resource_class, feature) Comment .where(decidim_root_commentable_id: resource_class.where(feature: feature)) .where(decidim_root_commentable_type: resource_class.to_s) end module_function :comments_for_resource end end end
Version data entries
56 entries across 56 versions & 2 rubygems