Sha256: 604517434312108a54a0f1484f3d262e6a4ccab947bc75812c88f62fcf232bbb
Contents?: true
Size: 688 Bytes
Versions: 12
Compression:
Stored size: 688 Bytes
Contents
# frozen_string_literal: true module Decidim module Initiatives # Class used the retrieve the authorizations for a user. class UserAuthorizations < Decidim::Query attr_reader :user # Syntactic sugar to initialize the class and return the queried objects. # # user - Decidim::User def self.for(user) new(user).query end # Retrieves authorizations for the given user # # user - Decidim::User def initialize(user) @user = user end # Retrieves authorizations for the given user. def query Authorization.where(user: user).where.not(granted_at: nil) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems