]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
Ensure that deactivate isn't available in production
[rails.git] / app / models / user.rb
index cc12adecc467c66a39aab7adab446cc0d4a5ccfb..722d65302a3f155a1770cf3391413ee7ad12e8df 100644 (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