Sha256: f5c78d086db440a4fbf28e509ccc7d9ad8651019ac1e1d73b75456059c3a3add

Contents?: true

Size: 575 Bytes

Versions: 10

Compression:

Stored size: 575 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 SupportPeriodFinishedInitiatives < Rectify::Query
      # Retrieves the initiatives ready to be evaluated to decide if they've been
      # accepted or not.
      def query
        Decidim::Initiative
          .includes(:scoped_type)
          .where(state: "published")
          .where(signature_type: "online")
          .where("signature_end_time < ?", DateTime.current)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
decidim-initiatives-0.13.1 app/queries/decidim/initiatives/support_period_finished_initiatives.rb
decidim-initiatives-0.12.2 app/queries/decidim/initiatives/support_period_finished_initiatives.rb
decidim-initiatives-0.13.0 app/queries/decidim/initiatives/support_period_finished_initiatives.rb
decidim-initiatives-0.12.1 app/queries/decidim/initiatives/support_period_finished_initiatives.rb
decidim-initiatives-0.13.0.pre1 app/queries/decidim/initiatives/support_period_finished_initiatives.rb
decidim-initiatives-0.12.0 app/queries/decidim/initiatives/support_period_finished_initiatives.rb
decidim-initiatives-0.11.2 app/queries/decidim/initiatives/support_period_finished_initiatives.rb
decidim-initiatives-0.12.0.pre app/queries/decidim/initiatives/support_period_finished_initiatives.rb
decidim-initiatives-0.11.1 app/queries/decidim/initiatives/support_period_finished_initiatives.rb
decidim-initiatives-0.11.0.pre1 app/queries/decidim/initiatives/support_period_finished_initiatives.rb