Add association Person#relationships
This commit is contained in:
parent
ef202d3994
commit
cd66bd75f2
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Reference in New Issue