Skip to content

Commit

Permalink
fix: HOTFIX migration task
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet committed Aug 8, 2022
1 parent 31769d5 commit 8e272e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tasks/events.rake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace :events do
desc 'Fill missing subscription_id'
task fill_subscription: :environment do
Event.where(subscription_id: nil).find_each do |event|
subscription = event.customer.active_subscription || event.customer.subscriptions.order(&:created_at).last
subscription = event.customer.active_subscription || event.customer.subscriptions.order(:created_at).last

event.update!(subscription_id: subscription.id)
end
Expand Down

0 comments on commit 8e272e3

Please sign in to comment.