Commit Graph

18 Commits

Author SHA1 Message Date
0daf413b47 Prevent sole admin from deleting their account
Without this guard, the last admin in the system could delete their own
account, making the application unmanageable. This adds a model method
`User#sole_admin?`, a controller guard in `RegistrationsController#destroy`,
and disables the delete button in the profile edit view when the current
user is the only remaining admin.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 06:52:14 +00:00
80130fb7d1 Allow cascade delete Unit/Quantity
Closes #32
2026-02-22 17:50:43 +01:00
da38d8b585 Create Devise routes only when 'users' table exists
Closes #42
2025-07-25 15:30:26 +02:00
9dbcfddf98 Merge corrections provided by Bambuch, cont. 2025-04-26 19:12:56 +02:00
c48bf290fd Implement Measurements#new 2025-02-18 11:25:32 +01:00
aa862f0e90 Quantities index WIP 2025-01-05 20:47:49 +01:00
0b201606c2 Replace #columns_hash with #type_for_attribute for limits 2024-12-08 13:47:30 +01:00
d6fdff252a Validate User 'email' and 'unconfirmed_email' lengths
Closes #6
2024-11-24 14:11:54 +01:00
e75391ae18 Display User name using #to_s 2024-11-23 14:55:29 +01:00
4447735dce First part of portability checks 2024-11-15 02:02:19 +01:00
4e91c89153 List units ordered, not using nested_set 2024-01-09 00:11:26 +01:00
a4745c9cb8 Add Units 2023-07-06 18:34:16 +02:00
cc65b64a4b Move status checking to model 2023-05-02 03:17:41 +02:00
353049a6b2 Set User :confirmable
Renumber statuses to make :disabled == 0
2023-04-14 21:35:32 +02:00
0e72219373 Require authentication 2023-04-01 18:53:30 +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