1
0
Fork 0

Add association Person#relationships

This commit is contained in:
Alex Kotov 2019-04-28 18:08:02 +05:00
parent ef202d3994
commit cd66bd75f2
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
2 changed files with 8 additions and 0 deletions

View File

@ -11,6 +11,8 @@ class Person < ApplicationRecord
has_one :account, dependent: :restrict_with_exception
has_many :relationships, dependent: :restrict_with_exception
has_many :passports, dependent: :restrict_with_exception
has_many :resident_registrations, dependent: :restrict_with_exception

View File

@ -11,6 +11,12 @@ RSpec.describe Person do
it { is_expected.to have_one(:account).dependent(:restrict_with_exception) }
it do
is_expected.to \
have_many(:relationships)
.dependent(:restrict_with_exception)
end
it do
is_expected.to \
have_many(:passports)