diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-25 11:47:37 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-25 11:47:37 +0000 |
commit | 302c23d5a6c1df4a5a9f373e545db5f8a894bdd6 (patch) | |
tree | 335ff85f5a4bc4873276cfbecace495d3ae33079 /activerecord/test | |
parent | 3eed3272d7fc79040b6eb3b8586be0d8875d8203 (diff) | |
download | rails-302c23d5a6c1df4a5a9f373e545db5f8a894bdd6.tar.gz rails-302c23d5a6c1df4a5a9f373e545db5f8a894bdd6.tar.bz2 rails-302c23d5a6c1df4a5a9f373e545db5f8a894bdd6.zip |
Fixed Base#find to honor the documentation on how :joins work and make them consistent with Base#count #1405 [pritchie@gmail.com] Improved dynamic finder docs #1495 [laurel@gorgorg.org]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/finder_test.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/test/finder_test.rb b/activerecord/test/finder_test.rb index 06c5229433..1ac97271eb 100644 --- a/activerecord/test/finder_test.rb +++ b/activerecord/test/finder_test.rb @@ -292,8 +292,11 @@ class FinderTest < Test::Unit::TestCase end def test_find_all_with_join - developers_on_project_one = Developer.find :all, :joins => 'developers_projects', :conditions => 'id=developer_id AND project_id=1' - + developers_on_project_one = Developer.find( + :all, + :joins => 'LEFT JOIN developers_projects ON developers.id = developers_projects.developer_id', + :conditions => 'project_id=1' + ) assert_equal 2, developers_on_project_one.length developer_names = developers_on_project_one.map { |d| d.name } assert developer_names.include?('David') |