27 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
ae5bad89ac Update db schema 2025-07-25 15:31:41 +02: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
5fff9adf4d Delete Units respecting foreign key constraint 2025-01-16 20:46:22 +01:00
c908063212 Persist Quantity :depth instead of computing it on the fly 2025-01-16 17:14:52 +01:00
0dc683da4f Initialize units hash before use 2025-01-11 21:53:02 +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
3788f1a749 Fix db:seed:export task
* replace variable names with Hash to avoid invalid Ruby identifiers
* export all values as single-quoted to avoid string interpolation and
  treating BigDecimal numbers as Float
* #truncate table instead of #delete_all to avoid foreing_key
  constraints errors

Closes #56
2025-01-05 21:05:47 +01:00
141d67ad21 Add Quantities table 2025-01-05 00:44:02 +01:00
a18f257378 Schema update 2024-12-08 15:28:38 +01:00
2e4eb3d4b5 Rake task to export default settings as seeds 2024-12-06 01:17:05 +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
8c11caaa4b Add default Units seed 2024-04-07 00:42:15 +02: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
30af21d580 Seed confirmed admin account 2023-04-15 01:25:34 +02:00
18ec9f7e16 Add schema.rb 2023-04-11 18:38:47 +02:00
e29c060a39 Add user statuses and seed admin user 2023-04-01 02:29:59 +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
6d2d12a9da rails new
THOR_MERGE=vimdiff bundle exec rails new -d mysql --skip-action-mailbox
  --skip-action-text --skip-active-job --skip-active-storage
  --skip-action-cable --skip-hotwire --skip-jbuilder --skip-bootsnap
  --skip-bundle .
2023-03-05 19:23:29 +01:00