Class: Decidim::Initiatives::SupportPeriodFinishedInitiatives

Inherits:
Query
  • Object
show all
Defined in:
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

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 '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