Make Person#regional_office optional
This commit is contained in:
parent
c875c2ffa8
commit
a571f7600d
2 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Person < ApplicationRecord
|
||||
belongs_to :regional_office
|
||||
belongs_to :regional_office, optional: true
|
||||
|
||||
has_one :account, dependent: :restrict_with_exception
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ require 'rails_helper'
|
|||
RSpec.describe Person do
|
||||
subject { create :person }
|
||||
|
||||
it { is_expected.to belong_to(:regional_office) }
|
||||
it { is_expected.to belong_to(:regional_office).optional }
|
||||
|
||||
it { is_expected.to have_one(:account).dependent(:restrict_with_exception) }
|
||||
|
||||
|
|
Reference in a new issue