1
0
Fork 0

Do not autoset Person#contacts_list

This commit is contained in:
Alex Kotov 2019-06-27 05:45:16 +05:00
parent 0ba3446032
commit 855a1b05c7
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
2 changed files with 2 additions and 8 deletions

View File

@ -32,12 +32,4 @@ class Person < ApplicationRecord
###############
validates :contacts_list, uniqueness: true
#############
# Callbacks #
#############
before_validation do
self.contacts_list ||= ContactsList.new
end
end

View File

@ -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 }