Class: Decidim::Initiatives::SupportPeriodFinishedInitiatives

Inherits:
Query
  • Object
show all
Defined in:
decidim-initiatives/app/queries/decidim/initiatives/support_period_finished_initiatives.rb

Overview

Class uses to retrieve initiatives that have been a long time in validating state

Instance Method Summary collapse

Methods inherited from Query

#cached_query, #each, #eager?, #exists?, #initialize, merge, #none?, #relation?, #|

Constructor Details

This class inherits a constructor from Decidim::Query

Instance Method Details

#queryObject

Retrieves the initiatives ready to be evaluated to decide if they have been accepted or not.



10
11
12
13
14
15
16
# File 'decidim-initiatives/app/queries/decidim/initiatives/support_period_finished_initiatives.rb', line 10

def query
  Decidim::Initiative
    .includes(:scoped_type)
    .where(state: "published")
    .where(signature_type: "online")
    .where("signature_end_date < ?", Date.current)
end