Sha256: e8049ae46b45729e33844ad7124ba1d0c34a8ead3409eb7e721ac82f7a84fbf6

Contents?: true

Size: 435 Bytes

Versions: 35

Compression:

Stored size: 435 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Assemblies
    # This query filters assemblies by type.
    class FilteredAssemblies < Rectify::Query
      def initialize(filter)
        @filter = filter
      end

      def assemblies
        Decidim::Assembly
      end

      def query
        return assemblies.all if @filter.blank?

        assemblies.where(decidim_assemblies_type_id: @filter)
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
decidim-assemblies-0.26.10 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.26.9 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.26.8 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.26.7 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.26.5 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.26.4 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.26.3 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.26.2 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.26.1 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.26.0 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.26.0.rc2 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.26.0.rc1 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.25.2 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.25.1 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.25.0 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.25.0.rc4 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.25.0.rc3 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.25.0.rc2 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.25.0.rc1 app/queries/decidim/assemblies/filtered_assemblies.rb
decidim-assemblies-0.24.3 app/queries/decidim/assemblies/filtered_assemblies.rb