about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-08-19 11:40:42 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-08-19 11:40:42 +0200
commitcb62a83a71a9679061f8daa468119124b5da5e76 (patch)
treede738499adbad4d4ebbd76401b3632946d0fa96e /app/models
parent9b6a5ed109e1986149c1f15a41d4f442ae8ae39c (diff)
Add invite comments (#10465)
Diffstat (limited to 'app/models')
-rw-r--r--app/models/invite.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/invite.rb b/app/models/invite.rb
index 02ab8e0b2..29d25eae8 100644
--- a/app/models/invite.rb
+++ b/app/models/invite.rb
@@ -12,6 +12,7 @@
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
 #  autofollow :boolean          default(FALSE), not null
+#  comment    :text
 #
 
 class Invite < ApplicationRecord
@@ -22,6 +23,8 @@ class Invite < ApplicationRecord
 
   scope :available, -> { where(expires_at: nil).or(where('expires_at >= ?', Time.now.utc)) }
 
+  validates :comment, length: { maximum: 420 }
+
   before_validation :set_code
 
   def valid_for_use?