Ensure that deactivate isn't available in production

It's only used as a workaround for factories not being able to create
pending users while keeping active as the default
This commit is contained in:
Andy Allan 2022-02-02 17:47:45 +00:00
parent 2731e7244a
commit 2d47d6b4f8

View file

@ -172,8 +172,10 @@ class User < ApplicationRecord
end
# Used in test suite, not something that we would normally need to do.
event :deactivate do
transitions :from => :active, :to => :pending
if Rails.env.test?
event :deactivate do
transitions :from => :active, :to => :pending
end
end
# To confirm an account is used to override the spam scoring