about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/list.rb4
-rw-r--r--app/models/user.rb7
2 files changed, 9 insertions, 2 deletions
diff --git a/app/models/list.rb b/app/models/list.rb
index 8493046e5..655d55ff6 100644
--- a/app/models/list.rb
+++ b/app/models/list.rb
@@ -8,7 +8,7 @@
 #  title          :string           default(""), not null
 #  created_at     :datetime         not null
 #  updated_at     :datetime         not null
-#  replies_policy :integer          default("list_replies"), not null
+#  replies_policy :integer          default("list"), not null
 #
 
 class List < ApplicationRecord
@@ -16,7 +16,7 @@ class List < ApplicationRecord
 
   PER_ACCOUNT_LIMIT = 50
 
-  enum replies_policy: [:list_replies, :all_replies, :no_replies], _prefix: :show
+  enum replies_policy: [:list, :followed, :none], _prefix: :show
 
   belongs_to :account, optional: true
 
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) }