Sha256: d961e0e13c9626867fef914adcd9fbffb83ec1d90916d61df3d4c4cbc9dc12bf
Contents?: true
Size: 876 Bytes
Versions: 53
Compression:
Stored size: 876 Bytes
Contents
# frozen_string_literal: true module Decidim module Initiatives # Class uses to retrieve initiatives that have been a long time in # validating state class OutdatedValidatingInitiatives < Rectify::Query # Syntactic sugar to initialize the class and return the queried objects. # # period_length - Maximum time in validating state def self.for(period_length) new(period_length).query end # Initializes the class. # # period_length - Maximum time in validating state def initialize(period_length) @period_length = Time.current - period_length end # Retrieves the available initiative types for the given organization. def query Decidim::Initiative .where(state: "validating") .where("updated_at < ?", @period_length) end end end end
Version data entries
53 entries across 53 versions & 1 rubygems