]> git.openstreetmap.org Git - rails.git/commit
Use a state machine for user status
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 5 Jan 2022 18:44:46 +0000 (18:44 +0000)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 12 Jan 2022 18:16:14 +0000 (18:16 +0000)
commit1a11c4dc191d93b18fcf5aa917448c8cd6d2556b
tree16e6de6c73271ed101f83e253e1f5291b0576d1b
parent786f28993a0bcea6f1735ff5a2ee0ef06ba1871c
Use a state machine for user status

The user status is a bit complex, since there are various states and
not all transitions between them make sense.

Using AASM means that we can name and restrict the transitions, which
hopefully makes them easier to reason about.
12 files changed:
app/controllers/confirmations_controller.rb
app/controllers/passwords_controller.rb
app/controllers/users_controller.rb
app/models/user.rb
app/views/users/show.html.erb
test/controllers/browse_controller_test.rb
test/controllers/confirmations_controller_test.rb
test/controllers/users_controller_test.rb
test/factories/user.rb
test/models/user_test.rb
test/system/diary_entry_test.rb
test/system/user_suspension_test.rb