16 Commits

Author SHA1 Message Date
7904ff3ef9 Add web-based installation wizard
Replace the CLI-only setup (db:seed + manual application.rb edits)
with a web wizard shown automatically on first visit when no admin
account exists yet.

SetupController (GET/POST /setup) collects the admin e-mail and
password, a "skip e-mail confirmation" toggle, and an option to
seed the built-in default units.  Once submitted it creates the
admin User, persists the chosen options as Setting records, and
redirects to the sign-in page.

ApplicationController gains a redirect_to_setup_if_needed
before_action that catches every request (including Devise routes)
when no admin exists, so a fresh installation always lands on the
wizard rather than an empty sign-in form.

A new Setting model provides a lightweight key-value store for
runtime options that were previously hard-coded in application.rb
(e.g. skip_email_confirmation).  RegistrationsController now reads
that flag from the database instead of from the application config.

Seeds.rb is kept for headless / automated deployments and skips
admin creation when an admin already exists (idempotent), with a
comment pointing to the web wizard as the preferred path.

Also extends the SQLite nil-limit fix (|| Float::INFINITY) to the
Quantity model, which suffered the same ArgumentError as Unit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 17:19:24 +00: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