From 585ad7d9a432066da0c3d604d1e145e94cd78b9c Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 15 Dec 2023 15:12:17 +0530 Subject: [PATCH] feat: remove validations from user and account --- app/models/account.rb | 1 - app/models/user.rb | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/account.rb b/app/models/account.rb index c1a5773bb..38c3cf53b 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -32,7 +32,6 @@ class Account < ApplicationRecord check_for_column: false }.freeze - validates :name, presence: true validates :auto_resolve_duration, numericality: { greater_than_or_equal_to: 1, less_than_or_equal_to: 999, allow_nil: true } validates :domain, length: { maximum: 100 } diff --git a/app/models/user.rb b/app/models/user.rb index 6ff4fb61d..268618f17 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -68,8 +68,7 @@ class User < ApplicationRecord # work because :validatable in devise overrides this. # validates_uniqueness_of :email, scope: :account_id - validates :email, :name, presence: true - validates_length_of :name, minimum: 1, maximum: 255 + validates :email, presence: true has_many :account_users, dependent: :destroy_async has_many :accounts, through: :account_users