Commit Graph

17 Commits

Author SHA1 Message Date
3702e24153 Add taken_at to readouts and default unit to quantities
Readouts gain a taken_at timestamp (distinct from created_at) that records
when the measurement was actually taken. Measurements are now ordered by
taken_at descending.

Quantities gain an optional default_unit association. When set, the unit
is pre-selected in the measurement form. A "Set as default" button on the
unit selector lets users update the default directly from the form.

- Migrations: add taken_at (datetime) to readouts,
              add default_unit_id (fk → units) to quantities
- Readout: expose taken_at in ATTRIBUTES permit-list
- Quantity: add default_unit belongs_to, expose in ATTRIBUTES
- QuantitiesController: load @user_units for form actions
- Quantities views: add Default unit column and select to form
- Readouts form: pre-select default unit; add "Set as default" button
  (readoutUnitChanged / setDefaultUnit wired up in a later commit)
- Measurements form: default taken_at input to current time
- ApplicationHelper: propagate :form option to html_options in builder
- config/environments/test.rb: allow Capybara's dynamic host
- Tests: system tests for default-unit UI on the Quantities page

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 22:01:52 +00:00
687e6fcdff Drop Readout.value decimal type in favor of float 2026-03-19 20:30:16 +01:00
80130fb7d1 Allow cascade delete Unit/Quantity
Closes #32
2026-02-22 17:50:43 +01:00
1cddc794d2 Cleanup Quantity :pathname related code 2025-03-23 13:11:14 +01:00
3b30e58ff3 Persist Quantity :pathname 2025-03-23 12:56:57 +01:00
3d7daa8944 Create Readout model 2025-01-22 00:14:57 +01:00
c908063212 Persist Quantity :depth instead of computing it on the fly 2025-01-16 17:14:52 +01:00
b6acb30785 Make Quantity name unique among siblings
Remove Quantity domain - will be replaced by configurable per-domain
root Quantity, limiting selection to descendants only
2025-01-11 21:50:36 +01:00
141d67ad21 Add Quantities table 2025-01-05 00:44:02 +01:00
3711251656 Unit: limit symbol length, change name:string -> description:text
Closes #11
Closes #12
2024-11-24 15:13:59 +01:00
f3751c5fa1 Disallow NULLs 2024-11-23 23:50:57 +01:00
59db1fef17 Set multiplier default in db, not model 2024-03-15 19:36:05 +01:00
8dbc07ea1f Remove awesome_nested_set related columns 2024-01-17 04:23:48 +01:00
a4745c9cb8 Add Units 2023-07-06 18:34:16 +02:00
787eaba3b1 Set unconfirmed_email limit 2023-04-23 19:35:43 +02:00
16b067a377 Configure User with Devise
bundle exec rails generate devise User
2023-03-11 23:19:37 +01:00
deaf0fa73b Generate User scaffold
bundle exec rails generate scaffold user email:string{64}:uniq
  status:integer
2023-03-11 22:56:32 +01:00