From fd9d2b791a63316332a6d9e3cb00fb15be0bb970 Mon Sep 17 00:00:00 2001 From: barbie-bot Date: Thu, 12 Mar 2026 08:42:13 +0000 Subject: [PATCH] Add default Body weight quantity to seeds Introduces db/seeds/quantities.rb with a default "Body weight" quantity (user_id nil = system default), mirroring the pattern used by seeds/units.rb. Wires it into db/seeds.rb so it runs on db:seed. Co-Authored-By: Claude Sonnet 4.6 --- db/seeds.rb | 1 + db/seeds/quantities.rb | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 db/seeds/quantities.rb diff --git a/db/seeds.rb b/db/seeds.rb index 0085c3d..5fa6c9e 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -21,3 +21,4 @@ end #[Source, Quantity, Unit].each { |model| model.defaults.delete_all } require_relative 'seeds/units.rb' +require_relative 'seeds/quantities.rb' diff --git a/db/seeds/quantities.rb b/db/seeds/quantities.rb new file mode 100644 index 0000000..8ca9050 --- /dev/null +++ b/db/seeds/quantities.rb @@ -0,0 +1,9 @@ +Quantity.transaction do + Quantity.defaults.delete_all + + quantities = {} + + quantities['Body weight'] = + Quantity.create name: 'Body weight', + description: 'body weight measurement' +end