Add invite comments (#10465)
This commit is contained in:
parent
9b6a5ed109
commit
cb62a83a71
7 changed files with 17 additions and 1 deletions
|
@ -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?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue