Skip to content

Commit

Permalink
misc: Add missing require in DailyUsages::FillHistoryService
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet committed Nov 21, 2024
1 parent 2c97be8 commit 5980105
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/services/daily_usages/fill_history_service.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require "timecop"

module DailyUsages
class FillHistoryService < BaseService
def initialize(subscription:, from_datetime:)
Expand Down
4 changes: 1 addition & 3 deletions lib/tasks/daily_usages.rake
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'timecop'

namespace :daily_usages do
desc "Fill past daily usage"
task :fill_history, [:organization_id, :days_ago] => :environment do |_task, args|
Expand All @@ -15,7 +13,7 @@ namespace :daily_usages do
subscriptions = organization.subscriptions
.where(status: [:active, :terminated])
.where.not(started_at: nil)
.where('terminated_at IS NULL OR terminated_at >= ?', days_ago)
.where("terminated_at IS NULL OR terminated_at >= ?", days_ago)
.includes(customer: :organization)

subscriptions.find_each do |subscription|
Expand Down

0 comments on commit 5980105

Please sign in to comment.