@@ -50,11 +50,11 @@ describe "Query associations" do
5050 .create
5151
5252 posts = Post ::BaseQuery .new
53- .where_comments (CommentQuery .new.body_eq(" matching" ))
53+ .join_comments (CommentQuery .new.body_eq(" matching" ))
5454 posts.results.should eq([post_with_matching_comment])
5555
5656 posts = Post ::BaseQuery .new
57- .where_comments (Comment ::BaseQuery .new.body(" matching" ))
57+ .join_comments (Comment ::BaseQuery .new.body(" matching" ))
5858 posts.results.should eq([post_with_matching_comment])
5959 end
6060
@@ -72,8 +72,7 @@ describe "Query associations" do
7272 .create
7373
7474 posts = Post ::BaseQuery .new
75- .inner_join_comments
76- .where_comments(Comment ::BaseQuery .new.body.eq(" matching" ), auto_inner_join: false )
75+ .inner_join_comments(Comment ::BaseQuery .new.body.eq(" matching" ))
7776 posts.to_sql[0 ].should contain " INNER JOIN"
7877 posts.results.should eq([post_with_matching_comment])
7978 end
@@ -92,8 +91,7 @@ describe "Query associations" do
9291 .create
9392
9493 posts = Post ::BaseQuery .new
95- .left_join_comments
96- .where_comments(Comment ::BaseQuery .new.body.eq(" matching" ), auto_inner_join: false )
94+ .left_join_comments(Comment ::BaseQuery .new.body.eq(" matching" ))
9795 posts.to_sql[0 ].should contain " LEFT JOIN"
9896 posts.results.should eq([post_with_matching_comment])
9997 end
@@ -112,8 +110,7 @@ describe "Query associations" do
112110 .create
113111
114112 posts = Post ::BaseQuery .new
115- .right_join_comments
116- .where_comments(Comment ::BaseQuery .new.body.eq(" matching" ), auto_inner_join: false )
113+ .right_join_comments(where_comments: Comment ::BaseQuery .new.body.eq(" matching" ))
117114 posts.to_sql[0 ].should contain " RIGHT JOIN"
118115 posts.results.should eq([post_with_matching_comment])
119116 end
@@ -132,15 +129,14 @@ describe "Query associations" do
132129 .create
133130
134131 posts = Post ::BaseQuery .new
135- .full_join_comments
136- .where_comments(Comment ::BaseQuery .new.body.eq(" matching" ), auto_inner_join: false )
132+ .full_join_comments(Comment ::BaseQuery .new.body.eq(" matching" ))
137133 posts.to_sql[0 ].should contain " FULL JOIN"
138134 posts.results.should eq([post_with_matching_comment])
139135 end
140136
141137 it " can query associations on namespaced models" do
142138 orgs = NamedSpaced ::Organization ::BaseQuery .new
143- .where_locations (NamedSpaced ::Location ::BaseQuery .new.name(" Home" ))
139+ .join_locations (NamedSpaced ::Location ::BaseQuery .new.name(" Home" ))
144140 orgs.to_sql[0 ].should contain " INNER JOIN"
145141
146142 staff = NamedSpaced ::Staff ::BaseQuery .new
@@ -154,9 +150,9 @@ describe "Query associations" do
154150
155151 line_item_query = LineItemQuery .new
156152 .id(item.id)
157- .where_associated_products (ProductQuery .new.id(product.id))
153+ .join_associated_products (ProductQuery .new.id(product.id))
158154 result = LineItemProductQuery .new
159- .where_line_item (line_item_query)
155+ .join_line_item (line_item_query)
160156 .find(line_item_product.id)
161157
162158 result.should eq(line_item_product)
@@ -169,9 +165,9 @@ describe "Query associations" do
169165
170166 line_item_query = LineItemQuery .new
171167 .id(item.id)
172- .where_line_items_products (LineItemProductQuery .new.id(line_item_product.id))
168+ .join_line_items_products (LineItemProductQuery .new.id(line_item_product.id))
173169 result = ProductQuery .new
174- .where_line_items (line_item_query)
170+ .join_line_items (line_item_query)
175171 .find(product.id)
176172
177173 result.should eq(product)
0 commit comments