From 855a1b05c7b1baa9673623c70c903f2efeb6cc34 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Thu, 27 Jun 2019 05:45:16 +0500 Subject: [PATCH] Do not autoset Person#contacts_list --- app/models/person.rb | 8 -------- factories/people.rb | 2 ++ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index ae837e5..ba42250 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -32,12 +32,4 @@ class Person < ApplicationRecord ############### validates :contacts_list, uniqueness: true - - ############# - # Callbacks # - ############# - - before_validation do - self.contacts_list ||= ContactsList.new - end end diff --git a/factories/people.rb b/factories/people.rb index 7bca241..e0f2dff 100644 --- a/factories/people.rb +++ b/factories/people.rb @@ -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 }