FIX: allow invite email field to be blank for invite tokens

This commit is contained in:
Arpit Jalan 2020-03-30 10:35:12 +05:30
parent 8ab39f6916
commit 435fe8ac6e
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ class Invite < ActiveRecord::Base
has_many :topic_invites
has_many :topics, through: :topic_invites, source: :topic
validates_presence_of :invited_by_id
validates :email, email: true, format: { with: EmailValidator.email_regex }
validates :email, email: true, format: { with: EmailValidator.email_regex }, allow_blank: true
before_create do
self.invite_key ||= SecureRandom.hex