1
0
Fork 0

Make Person#regional_office optional

This commit is contained in:
Alex Kotov 2018-12-15 10:54:45 +05:00
parent c875c2ffa8
commit a571f7600d
No known key found for this signature in database
GPG Key ID: 4E831250F47DE154
2 changed files with 2 additions and 2 deletions

View File

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

View File

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