Skip to content

Commit

Permalink
[FIX] Import transfer: movements & transfer with the same created_at
Browse files Browse the repository at this point in the history
  • Loading branch information
franpb14 authored Jan 7, 2024
1 parent 9e5c05f commit 615e4d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/transfer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class Transfer < ApplicationRecord
after_create :make_movements

def make_movements
movements.create(account: Account.find(source_id), amount: -amount.to_i)
movements.create(account: Account.find(destination_id), amount: amount.to_i)
movements.create(account: Account.find(source_id), amount: -amount.to_i, created_at: created_at)
movements.create(account: Account.find(destination_id), amount: amount.to_i, created_at: created_at)
end

def source_id
Expand Down

0 comments on commit 615e4d1

Please sign in to comment.