Sha256: 3ee692f46aefa32bd0d6c0c81e6600ecc4d2b1a11f1269191fc2cea7bce29faa

Contents?: true

Size: 412 Bytes

Versions: 17

Compression:

Stored size: 412 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Assemblies
    # This query class filters assemblies given a current_user.
    class VisibleAssemblies < Rectify::Query
      def initialize(user)
        @user = user
      end

      def query
        if @user
          Decidim::Assembly.visible_for(@user.id)
        else
          Decidim::Assembly.public_spaces
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
decidim-assemblies-0.15.2 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.15.1 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.15.0 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.14.4 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.14.3 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.14.2 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.14.1 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.13.1 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.12.2 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.13.0 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.12.1 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.13.0.pre1 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.12.0 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.11.2 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.12.0.pre app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.11.1 app/queries/decidim/assemblies/visible_assemblies.rb
decidim-assemblies-0.11.0.pre1 app/queries/decidim/assemblies/visible_assemblies.rb