change validations
This commit is contained in:
@@ -3,7 +3,8 @@ class Client < ApplicationRecord
|
||||
has_many :owner_subprojects, class_name: 'Subproject', foreign_key: 'owner_id'
|
||||
has_many :builder_subprojects, class_name: 'Subproject', foreign_key: 'builder_id'
|
||||
|
||||
validates :company_name, :firstname, :lastname, :email, presence: true
|
||||
validates :company_name, :firstname, :lastname, presence: true
|
||||
validates :email, presence: true, uniqueness: true
|
||||
|
||||
def referenced_count
|
||||
owner_subprojects.count + builder_subprojects.count + client_subprojects.count
|
||||
|
||||
Reference in New Issue
Block a user