aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relation/merging_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Load :developers fixtures where expecting a Developer to be thereAkira Matsuda2014-09-051-1/+1
|
* "warning: assigned but unused variable"Akira Matsuda2014-08-211-1/+1
|
* Only merge scopes with zero arity in has_many throughAgis-2014-08-201-0/+13
| | | | | | | | | | | | | | | with dynamic conditions. Fixes #16128 This bug was introduced in https://github.com/rails/rails/commit/c35e438620f2d56562251571377995359546393d so it's present from 4.1.2-rc1 and after. https://github.com/rails/rails/commit/c35e438620f2d56562251571377995359546393d merges any relation scopes passed as proc objects to the relation, but does *not* take into account the arity of the lambda. To reproduce: https://gist.github.com/Agis-/5f1f0d664d2cd08dfb9b
* Merge pull request #15078 from nbudin/fix_merger_filter_binds_comparison_masterRafael Mendonça França2014-05-141-0/+5
|\ | | | | | | | | | | | | Make filter_binds filter out symbols that are equal to strings Conflicts: activerecord/CHANGELOG.md
| * Make filter_binds filter out symbols that are equal to stringsNat Budin2014-05-141-0/+5
|/ | | | | | | | | | | | | ActiveRecord::Relation::Merger's filter_binds method does not filter out bind variables when one of the attribute nodes has a string name, but the other has a symbol name, even when those names are actually equal. This can result in there being more bind variables than placeholders in the generated SQL. This is particularly an issue for PostgreSQL, where this is treated as an error. This patch changes the filter_binds method to make it convert both attribute names to strings before comparing.
* Modify assert conditions not to be affectedYasuo Honda2014-05-121-2/+3
| | | | by each database bind variable naming conventions
* remove the bind substitution visitor. to_sql should never return bind valuesAaron Patterson2014-04-091-3/+1
|
* Merge branch 'master' into set_bindsAaron Patterson2014-01-141-2/+2
|\ | | | | | | | | | | | | | | * master: rm dup code Conflicts: activerecord/test/cases/relations_test.rb
* | where uses bind values so we don't need to manually create themAaron Patterson2014-01-141-11/+3
| |
* | remove test that does not apply anymoreAaron Patterson2014-01-141-12/+1
|/
* use arel nodes to represent non-string `order_values`.Yves Senn2013-11-191-0/+12
| | | | | | | | | | | | | | | | | | | This fixes a bug when merging relations of different classes. ``` Given: Post.joins(:author).merge(Author.order(name: :desc)).to_sql Before: SELECT "posts".* FROM "posts" INNER JOIN "authors" ON "authors"."id" = "posts"."author_id" ORDER BY "posts"."name" DESC After: SELECT "posts".* FROM "posts" INNER JOIN "authors" ON "authors"."id" = "posts"."author_id" ORDER BY "authors"."name" DESC ```
* Address test_merging_where_relations failure by adding `order("posts.id")`Yasuo Honda2013-11-181-1/+1
|
* fix weird Emacs auto indentation. [ci skip]Yves Senn2013-11-131-8/+8
|
* tests for merging Relations of different classes.Yves Senn2013-11-131-0/+19
|
* move Relation#merge tests into separate file.Yves Senn2013-11-131-0/+131