From 435fe8ac6e17423eb8a786846338f613a39f385a Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Mon, 30 Mar 2020 10:35:12 +0530 Subject: [PATCH] FIX: allow invite email field to be blank for invite tokens --- app/models/invite.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/invite.rb b/app/models/invite.rb index bced2785df1..2618b37de9a 100644 --- a/app/models/invite.rb +++ b/app/models/invite.rb @@ -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