aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/support
diff options
context:
space:
mode:
authorChalo Fernandez <chalofa@gmail.com>2018-06-06 02:41:13 -0500
committerChalo Fernandez <chalofa@gmail.com>2018-06-06 02:43:46 -0500
commitfd689d9fb119ddababae55da40004815f7c4b32d (patch)
tree2cc95af76b3d5b6a6e75d668b82772dd7e3bcdc3 /activerecord/test/support
parentd0d3e964920602aa710507f6717010d852e37c86 (diff)
downloadrails-fd689d9fb119ddababae55da40004815f7c4b32d.tar.gz
rails-fd689d9fb119ddababae55da40004815f7c4b32d.tar.bz2
rails-fd689d9fb119ddababae55da40004815f7c4b32d.zip
Child joins should be aliased when merging relations
Rails 5.2 does not alias child joins, causing an error about duplicated table/fields: Example: Using some code like: `Post.joins(:author, :categorizations).merge(Author.select(:id)).merge(Categorization.joins(:author))` *Before this fix:* ` SELECT ... FROM "posts" INNER JOIN "authors" ON ... INNER JOIN "authors" ON ... ` *After this fix:* ` SELECT ... FROM "posts" INNER JOIN "authors" ON ... INNER JOIN "authors" "authors_categorizations" ON ... ` Before 5.2, Rails aliased the joins, but wrongfully transformed them into a LEFT OUTER JOIN. This fix will keep them as INNER JOINS, but make sure child joins are aliased, to avoid errors.
Diffstat (limited to 'activerecord/test/support')
0 files changed, 0 insertions, 0 deletions