1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix random CI failure due to non-deterministic has_one record

https://buildkite.com/rails/rails/builds/68645#ebd598f6-fe4c-4273-b1a9-c78055f21874/1016-1027
This commit is contained in:
Ryuta Kamizono 2020-05-03 23:51:30 +09:00
parent 72005ad0e1
commit 4c724df058

View file

@ -108,7 +108,7 @@ class Firm < Company
end
class DependentFirm < Company
has_one :account, foreign_key: "firm_id", dependent: :nullify
has_one :account, -> { order(:id) }, foreign_key: "firm_id", dependent: :nullify
has_many :companies, foreign_key: "client_of", dependent: :nullify
has_one :company, foreign_key: "client_of", dependent: :nullify
end