aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/finder_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/finder_test.rb')
-rw-r--r--activerecord/test/finder_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/finder_test.rb b/activerecord/test/finder_test.rb
index 3748e26f5e..88e8f14cf9 100644
--- a/activerecord/test/finder_test.rb
+++ b/activerecord/test/finder_test.rb
@@ -276,6 +276,14 @@ class FinderTest < Test::Unit::TestCase
assert_equal 'fixture_9', last_two_developers.first.name
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'
+
+ assert_equal 2, developers_on_project_one.length
+ assert_equal 'David', developers_on_project_one.first.name
+ assert_equal 'Jamis', developers_on_project_one.last.name
+ end
+
protected
def bind(statement, *vars)
if vars.first.is_a?(Hash)