diff options
| author | Dominic Cleal <dominic@cleal.org> | 2016-10-06 13:47:26 +0100 | 
|---|---|---|
| committer | Dominic Cleal <dominic@cleal.org> | 2016-11-24 09:27:33 +0000 | 
| commit | 15e2da656f41af0124f7577858536f3b65462ad5 (patch) | |
| tree | 1bbd1f076f37d73d79a1930e8b79d037e74364ef /activemodel/lib | |
| parent | 8556ab505a0a91efb529039b653984ab2b466a7e (diff) | |
| download | rails-15e2da656f41af0124f7577858536f3b65462ad5.tar.gz rails-15e2da656f41af0124f7577858536f3b65462ad5.tar.bz2 rails-15e2da656f41af0124f7577858536f3b65462ad5.zip | |
Restore RecordNotFound when *_ids= can't find records by ID
9c9fb19 changed the behaviour of the _ids= setters for associations to
raise an AssociationTypeMismatch when unknown IDs are given:
    Class: <ActiveRecord::AssociationTypeMismatch>
    Message: <"Developer(#43811860) expected, got NilClass(#16732720)">
This restores the original ActiveRecord::RecordNotFound exception with a
much clearer error message:
    Class: <ActiveRecord::RecordNotFound>
    Message: <"Couldn't find all Developers with 'id': (1, -9999) [WHERE \"contracts\".\"company_id\" = ?] (found 1 results, but was looking for 2)">
Fixes #25719
Diffstat (limited to 'activemodel/lib')
0 files changed, 0 insertions, 0 deletions
