Skip to content

Commit

Permalink
change date range for rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Sep 11, 2018
1 parent 2df024c commit 26ad107
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 26ad107

Please sign in to comment.