aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/left_outer_join_association_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix count which would sometimes force a DISTINCTMaxime Lapointe2016-08-161-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | The current behaviour of checking if there is a LEFT OUTER JOIN arel node to detect if we are doing eager_loading is wrong. This problem wasn't frequent before as only some pretty specific cases would add a LEFT OUTER JOIN arel node. However, the recent new feature left_outer_joins also add this node and made this problem happen frequently. Since in the perform_calculation function, we don't have access to eager_loading information, I had to extract the logic for the distinct out to the calculate method. As I was in the file for left_outer_join tests, I fixed a few that had bugs and I replaced some that were really weak with something that will catch more issues. In relation tests, the first test I changed would have failed if it had validated the hash returned by count instead of just checking how many pairs were in it. This is because this merge of join currently transforms the join node into an outer join node, which then made count do a distinct. So before this change, the return was {1=>1, 4=>1, 5=>1}.
* Add three new rubocop rulesRafael Mendonça França2016-08-161-3/+3
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* modernizes hash syntax in activerecordXavier Noria2016-08-061-3/+3
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-7/+7
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* adds missing requiresXavier Noria2016-07-241-0/+1
|
* systematic revision of =~ usage in ARXavier Noria2016-07-231-5/+5
| | | | | Where appropriatei, prefer the more concise Regexp#match?, String#include?, String#start_with?, or String#end_with?
* Allow Oracle bind parameter syntax `:a1`Yasuo Honda2016-06-081-1/+1
|
* Merge pull request #22125 from k0kubun/left_joinsSean Griffin2015-10-301-0/+5
|\ | | | | Alias left_joins to left_outer_joins
| * Alias left_joins to left_outer_joinsTakashi Kokubun2015-10-311-0/+5
| |
* | Fix test failures caused by #12071Sean Griffin2015-10-301-10/+10
|/ | | | | | This assumes only one query was ever executed, but it appears to sometimes be loading schema information. We can just look at the array of queries, rather than the "first" one that was run
* added ActiveRecord::Relation#left_outer_joinsFlorian Thomas2015-05-191-0/+74
Example: User.left_outer_joins(:posts) => SELECT "users".* FROM "users" LEFT OUTER JOIN "posts" ON "posts"."user_id" = "users"."id"