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:
parent
2731e7244a
commit
2d47d6b4f8
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue