Do not autoset Person#contacts_list
This commit is contained in:
parent
0ba3446032
commit
855a1b05c7
|
@ -32,12 +32,4 @@ class Person < ApplicationRecord
|
|||
###############
|
||||
|
||||
validates :contacts_list, uniqueness: true
|
||||
|
||||
#############
|
||||
# Callbacks #
|
||||
#############
|
||||
|
||||
before_validation do
|
||||
self.contacts_list ||= ContactsList.new
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
FactoryBot.define do
|
||||
factory :initial_person, class: Person do
|
||||
association :contacts_list
|
||||
|
||||
first_name { Faker::Name.first_name }
|
||||
middle_name { Faker::Name.first_name }
|
||||
last_name { Faker::Name.last_name }
|
||||
|
|
Reference in New Issue