Skip to content

Commit

Permalink
fix: migration
Browse files Browse the repository at this point in the history
  • Loading branch information
diegosteiner committed Dec 6, 2024
1 parent 77a3b48 commit 055ba2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/migrate/20241203101328_add_vat_category_id_to_tarifs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def change
def migrate_tarif(tarif)
return if !tarif.respond_to?(:vat) || tarif.vat.blank?

vat_category = organisation.vat_categories.find_or_create_by!(percentage: tarif.vat)
vat_category = tarif.organisation.vat_categories.find_or_create_by!(percentage: tarif.vat)
tarif.update(vat_category:)
tarif.invoice_parts.find_each { |invoice_part| invoice_part.update(vat_category:) }
end
Expand Down

0 comments on commit 055ba2f

Please sign in to comment.