You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating an invoice we request the Setting#next_invoice_id!, but this is committed immediately to the database even if the invoice is invalid and the transaction rolled back (contrary to when we assign an IP to a machine, both models get saved in the same transaction, but Rails knows they are related).
This means we generate invoice IDs with "holes" in the sequence, which is illegal.
When generating an invoice we request the
Setting#next_invoice_id!
, but this is committed immediately to the database even if the invoice is invalid and the transaction rolled back (contrary to when we assign an IP to a machine, both models get saved in the same transaction, but Rails knows they are related).This means we generate invoice IDs with "holes" in the sequence, which is illegal.
When we fix this, we should definitely add some tests for it (in
test/models/setting_test.rb
?)The text was updated successfully, but these errors were encountered: