Persist Quantity :depth instead of computing it on the fly

This commit is contained in:
2025-01-16 17:14:52 +01:00
parent 30686dd1fc
commit c908063212
3 changed files with 45 additions and 15 deletions

View File

@@ -5,6 +5,7 @@ class CreateQuantities < ActiveRecord::Migration[7.2]
t.string :name, null: false, limit: 31
t.text :description
t.references :parent, foreign_key: {to_table: :quantities}
t.integer :depth, null: false, default: 0
t.timestamps null: false
end