Sha256: 9a4a1d5fd81a950ba856f641d71d26eae3b3f5a7404b11829ff94988a94a60a5
Contents?: true
Size: 589 Bytes
Versions: 25
Compression:
Stored size: 589 Bytes
Contents
# frozen_string_literal: true module Decidim module Debates # This service scopes the debate searches with parameters that cannot be # passed from the user interface. class DebateSearch < ResourceSearch attr_reader :activity def build(params) @activity = params[:activity] if params[:activity] && user case params[:activity] when "commented" add_scope(:commented_by, user) when "my_debates" add_scope(:authored_by, user) end end super end end end end
Version data entries
25 entries across 25 versions & 1 rubygems