about summary refs log tree commit diff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2020-12-10 18:39:04 -0600
committerStarfall <us@starfall.systems>2020-12-10 18:39:04 -0600
commitab127fd7941b7c84e6d6fe3071d41f52affb143c (patch)
tree7daabe20eb581a2b9215ed9c4f161bcab89019bd /app/models/user.rb
parente68391fbaaf409cc01f74c8cf7076520a43ae06e (diff)
parent4acb5c90a271779a050c4d3b54562bd29359e5c0 (diff)
Merge branch 'glitch' into main
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 9bdbac76d..984f04b4e 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -89,6 +89,13 @@ class User < ApplicationRecord
   validates_with EmailMxValidator, if: :validate_email_dns?
   validates :agreement, acceptance: { allow_nil: false, accept: [true, 'true', '1'] }, on: :create
 
+  # Those are honeypot/antispam fields
+  attr_accessor :registration_form_time, :website, :confirm_password
+
+  validates_with RegistrationFormTimeValidator, on: :create
+  validates :website, absence: true, on: :create
+  validates :confirm_password, absence: true, on: :create
+
   scope :recent, -> { order(id: :desc) }
   scope :pending, -> { where(approved: false) }
   scope :approved, -> { where(approved: true) }