Skip to content

Commit fa83bd1

Browse files
authored
fix(Dr. Rai Reports): Bugs with Titration Data tools (#5652)
**Story card:** [sc-16391](https://app.shortcut.com/simpledotorg/story/16391/optimize-data-load-for-titration-indicator) ## Because Running this in SBX showed some errors ## This addresses Minor bug fixes ## Test instructions n.a
1 parent 7974fef commit fa83bd1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/services/dr_rai/data_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class << self
44
def populate klazz, timeline: nil
55
raise "Can only populate models" unless klazz < ApplicationRecord
66
if timeline.present?
7-
raise "timeline must be Date range" unless timelines.is_a?(Range)
7+
raise "timeline must be Date range" unless timeline.is_a?(Range)
88
end
99
new(klazz, timeline).populate!
1010
end

lib/tasks/dr_rai.rake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
namespace :dr_rai do
22
desc "Populate Titration Data"
3-
task :populate_titration_data, [:from_date, :to_date] => :environment do
3+
task :populate_titration_data, [:from_date, :to_date] => :environment do |_, args|
44
args.with_defaults(from_date: 1.year.ago.to_date, to_date: Date.today)
55
puts "Attempting to populate Dr. Rai titration data"
66
from_date = Date.parse(args[:from_date])
77
to_date = Date.parse(args[:to_date])
8-
DrRai::DataService.populate(DrRai::Data::Titration, from_date..to_date)
8+
DrRai::DataService.populate(DrRai::Data::Titration, timeline: from_date..to_date)
99
puts "Done populating Dr. Rai Titration data"
1010
end
1111
end

0 commit comments

Comments
 (0)