diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-01-24 15:13:16 -0800 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-01-24 15:13:16 -0800 |
commit | 220ee0c74abdcdeb62f30d829ba1475d63634241 (patch) | |
tree | ed80b6f6af8a94d31fea07f446d67aba4c664722 /activerecord/lib | |
parent | c438c61794f78d2b2f9023de707c84f9ee5e652f (diff) | |
parent | 3a0ddf33945219ea65777c1813902d783245739d (diff) | |
download | rails-220ee0c74abdcdeb62f30d829ba1475d63634241.tar.gz rails-220ee0c74abdcdeb62f30d829ba1475d63634241.tar.bz2 rails-220ee0c74abdcdeb62f30d829ba1475d63634241.zip |
Merge pull request #13785 from kuldeepaggarwal/fix-find_with_multiple_ids
Fix `ActiveRecord::RecordNotFound` error message with custom primary key
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 2dd1e6f14b..01d46f7676 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -311,9 +311,9 @@ module ActiveRecord conditions = " [#{conditions}]" if conditions if Array(ids).size == 1 - error = "Couldn't find #{@klass.name} with #{primary_key}=#{ids}#{conditions}" + error = "Couldn't find #{@klass.name} with '#{primary_key}'=#{ids}#{conditions}" else - error = "Couldn't find all #{@klass.name.pluralize} with IDs " + error = "Couldn't find all #{@klass.name.pluralize} with '#{primary_key}': " error << "(#{ids.join(", ")})#{conditions} (found #{result_size} results, but was looking for #{expected_size})" end |