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