Supports controller now fill the holes in the results: When there are no supports collected for one interval it takes the accumulated value from the previous one. Data starts in the publication date.
16 lines
379 B
Ruby
16 lines
379 B
Ruby
module Dashboard::ExpectsDateRange
|
|
extend ActiveSupport::Concern
|
|
|
|
include Dashboard::HasProposal
|
|
|
|
def start_date(fallback_date = proposal.created_at.to_date)
|
|
return Date.parse(params[:start_date]) unless params[:start_date].blank?
|
|
fallback_date
|
|
end
|
|
|
|
def end_date
|
|
return Date.parse(params[:end_date]) unless params[:end_date].blank?
|
|
Date.today
|
|
end
|
|
end
|