• D
    Restore RecordNotFound when *_ids= can't find records by ID · 15e2da65
    Dominic Cleal 提交于
    9c9fb19b 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
    15e2da65
collection_association.rb 17.2 KB