From 26ad107ff926619962ab8095e6144e54278aca89 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Tue, 11 Sep 2018 16:15:13 +0200 Subject: [PATCH] change date range for rake task --- app/models/doi.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index e64e27723..ccf0b2ee9 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -237,10 +237,10 @@ def self.find_by_id(id, options={}) end def self.index(options={}) - from_date = (options[:from_date].present? ? Date.parse(options[:from_date]) : Date.current).beginning_of_month - until_date = (options[:until_date].present? ? Date.parse(options[:until_date]) : Date.current).end_of_month + from_date = options[:from_date].present? ? Date.parse(options[:from_date]) : Date.current + until_date = options[:until_date].present? ? Date.parse(options[:until_date]) : Date.current - # get first day of every month between from_date and until_date + # get every day between from_date and until_date (from_date..until_date).each do |d| DoiIndexByDayJob.perform_later(from_date: d.strftime("%F")) end