Class: Decidim::Initiatives::SupportPeriodFinishedInitiatives

Inherits:
Rectify::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

Instance Method Details

#queryObject

Retrieves the initiatives ready to be evaluated to decide if they've 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