Sha256: f4632db1dc579e0be4e9c801abf81de12de1c4626227f395fc1335b6d1886ff6
Contents?: true
Size: 1.35 KB
Versions: 20
Compression:
Stored size: 1.35 KB
Contents
# frozen_string_literal: true require "active_support/concern" module Decidim module Moderations module Admin module Filterable extend ActiveSupport::Concern included do include Decidim::Admin::Filterable private def base_query collection end def filters [ :reportable_type_string_eq ] end def filters_with_values { reportable_type_string_eq: reportable_types } end def dynamically_translated_filters [:reportable_type_string_eq] end def translated_reportable_type_string_eq(value) value.constantize.name.demodulize end # Private: the predicate used by `Ransack` to perform a search. We used `reported` instead # of `reportable` because otherwise `Ransack` try to traverse the polymorphic # association automatically and it fails. def search_field_predicate :reported_id_string_or_reported_content_cont end def reportable_types collection.pluck(:decidim_reportable_type).uniq.sort end def extra_allowed_params [:hidden] end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems