aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relations_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Improve ordering of multiple columns on postgresqlLucia Escanellas2011-06-241-0/+7
| | | | | * Only on postgresql, order("first asc, second asc") was invalid * Closes #1720
* Support reversal of ARel orderings in reverse_sql_orderErnie Miller2011-06-201-0/+12
|
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* Merge branch 'master' into zomgAaron Patterson2011-03-291-0/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (51 commits) order is not guaranteed by this select, so add an order and call first! oracle stores this with microseconds, so convert to seconds before comparing make sure that active connections are not cleared during test when an exception happens clearing active connections in the ConnectionManagement middleware if an exception happens proxy body responses so we close database connections after body is flushed Pass the proper method_name instead of hardcoding to action_name. Quote find_in_batches ORDER BY clause [#6620 state:resolved] Delegate first!, last!, any? and many? to scoped Dont call authenticate_or_request_with_http_basic twice Remove 'warning: ambiguous first argument' when running ActionPack tests Change exists? so that it doesn't instantiate records [#6127 state:resolved] Move mapper_test to the appropriate location Update the wildcard route to be non-greedy by default, therefore be able to match the (.:format) segment [#6605 state:resolved] Fix examples Added Base.http_basic_authenticate_with to do simple http basic authentication with a single class method call [DHH] make sure we have an active database connection before running each connection management test adding active_connections? to the connection pool for finding open connections adding active_connection? to the connection pool testing app delegation from the ConnectionManagement middleware namespacing connection management tests. :heart: ...
| * Bring #reorder backSebastian Martinez2011-03-281-0/+6
| | | | | | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* | Use Arel to build subquery. Adapt tests to changed fixtures.John Mileham2011-03-241-3/+3
| |
* | Merge branch 'master' of github.com:rails/rails into count_behaviorJohn Mileham2011-03-241-20/+69
|\|
| * Merge branch 'master' into fuuuAaron Patterson2011-03-221-0/+8
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Do not show optional (.:format) block for wildcard route [#6605 state:resolved] pushing id insertion and prefetch primary keys down to Relation#insert use prepared statements to fetch the last insert id escaping binary data encoding when inserting to sqlite3. Thanks Naruse! [#6559 state:resolved] schemas set by set_table_name are respected by the mysql adapter. [#5322 state:resolved] Reapply extensions when using except and only SJIS is an alias to Windows-31J in ruby trunk. Use SHIFT_JIS for this test Improved resolver docs a bit [action_view] docs for FileSystemResolver [action_view] added custom patterns to template resolver
| | * Reapply extensions when using except and onlyIain Hecker2011-03-211-0/+8
| | |
| * | Add order clauses to fix some tests which were failing under 1.8 on oracle ↵Jon Leighton2011-03-181-5/+5
| | | | | | | | | | | | and postgres
| * | Merge branch 'master' into nested_has_many_throughJon Leighton2011-03-161-0/+26
| |\|
| | * Remove invalid testAndrew White2011-03-131-5/+1
| | | | | | | | | | | | | | | The test fails on PostgreSQL when trying to load the records as the comments_count field is not included in the GROUP BY clause.
| | * Fixed a bug when empty? was called on a grouped Relation that wasn't loadedChris Oliver2011-03-121-0/+30
| | | | | | | | | | | | | | | | | | [#5829 state:resolved] Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
| | * Referencing a table via the ON condition in a join should force that table ↵Jon Leighton2011-03-071-0/+15
| | | | | | | | | | | | to be eager-loaded via a JOIN rather than via subsequent queries.
| * | Referencing a table via the ON condition in a join should force that table ↵Jon Leighton2011-03-071-0/+15
| | | | | | | | | | | | to be eager-loaded via a JOIN rather than via subsequent queries.
| * | Merge branch 'master' into nested_has_many_throughJon Leighton2011-03-041-24/+86
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/class_methods/join_dependency.rb activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb activerecord/lib/active_record/associations/has_many_association.rb activerecord/lib/active_record/associations/has_many_through_association.rb activerecord/lib/active_record/associations/has_one_association.rb activerecord/lib/active_record/associations/has_one_through_association.rb activerecord/lib/active_record/associations/through_association_scope.rb activerecord/lib/active_record/reflection.rb activerecord/test/cases/associations/has_many_through_associations_test.rb activerecord/test/cases/associations/has_one_through_associations_test.rb activerecord/test/cases/reflection_test.rb activerecord/test/cases/relations_test.rb activerecord/test/fixtures/memberships.yml activerecord/test/models/categorization.rb activerecord/test/models/category.rb activerecord/test/models/member.rb activerecord/test/models/reference.rb activerecord/test/models/tagging.rb
| * | Merge branch 'master' into nested_has_many_throughJon Leighton2010-11-271-1/+29
| |\ \ | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/associations.rb
| * \ \ Merge branch 'master' into nested_has_many_throughJon Leighton2010-11-171-5/+30
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/associations/has_many_through_association.rb activerecord/test/cases/associations/has_many_through_associations_test.rb
| * \ \ \ Merge branch 'master' into nested_has_many_throughJon Leighton2010-11-081-1/+12
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/associations.rb
| * \ \ \ \ Merge branch 'master' into nested_has_many_throughJon Leighton2010-10-311-0/+5
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/associations/has_many_association.rb activerecord/lib/active_record/associations/through_association_scope.rb
| * \ \ \ \ \ Merge branch 'master' into nested_has_many_throughJon Leighton2010-10-281-7/+9
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/test/schema/schema.rb
| * | | | | | | Add explicit ordering in relations_test.rb, as the lack of this was causing ↵Jon Leighton2010-10-191-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | failures against postgres
| * | | | | | | Properly support conditions on any of the reflections involved in a nested ↵Jon Leighton2010-10-191-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | through association
| * | | | | | | Merge branch 'master' into nested_has_many_throughJon Leighton2010-10-141-6/+0
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/associations.rb activerecord/test/cases/associations/cascaded_eager_loading_test.rb
| * | | | | | | | Fix the tests (I have actually verified that these are also the 'right' ↵Jon Leighton2010-10-031-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes, rather than just making the tests pass again)
* | | | | | | | | Change behavior of count(:limit => x, :offset => y) to limit/offset before ↵John Mileham2011-03-031-0/+28
| |_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | counting.
* | | | | | | | Merge remote branch 'rails/master' into identity_mapEmilio Tagua2011-02-181-3/+37
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/associations/association.rb activerecord/lib/active_record/fixtures.rb
| * | | | | | | | explicitly allowing lolqueriesAaron Patterson2011-02-161-3/+10
| | | | | | | | |
| * | | | | | | | fixing whitespace problemsAaron Patterson2011-02-161-3/+3
| | | | | | | | |
| * | | | | | | | removed an unnecessary second query when passing an ActiveRecord::Relation ↵Steven Fenigstein2011-02-161-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to a where clause. And added ability to use subselects in where clauses.
* | | | | | | | | Fix expected queries in relation tests.Emilio Tagua2011-02-151-2/+2
| | | | | | | | |
* | | | | | | | | Run tests without IdentityMap when IM=false is given.Emilio Tagua2011-02-151-5/+5
| | | | | | | | |
* | | | | | | | | Merge remote branch 'rails/master' into identity_mapEmilio Tagua2011-02-151-9/+31
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/examples/performance.rb activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/autosave_association.rb activerecord/lib/active_record/base.rb activerecord/lib/active_record/nested_attributes.rb activerecord/test/cases/relations_test.rb
| * | | | | | | | Remove Relation#& alias for Relation#mergeErnie Miller2011-02-121-7/+7
| | | | | | | | |
| * | | | | | | | ActiveRecord::Relation#primary_key should return a string, just like ↵Jon Leighton2011-01-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActiveRecord::Base.primary_key does.
| * | | | | | | | Let AssociationCollection#find use #scoped to do its finding. Note that I am ↵Jon Leighton2011-01-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | removing test_polymorphic_has_many_going_through_join_model_with_disabled_include, since this specifies different behaviour for an association than for a regular scope. It seems reasonable to expect scopes and association proxies to behave in roughly the same way rather than having subtle differences.
| * | | | | | | | Fix test_any in relations_test.rb, which was failing when relations_test.rb ↵Jon Leighton2011-01-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is run on its own (it passes when the entire suite is run). This is a hacky fix for a problem I didn't quite get to the bottom of, so I'd welcome a better solution...
| * | | | | | | | Added one more failing test for bug #6036Robert Pankowecki (Gavdi)2011-01-041-0/+6
| | | | | | | | |
* | | | | | | | | Merge remote branch 'rails/master' into identity_mapEmilio Tagua2010-12-201-4/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/autosave_association.rb activerecord/lib/active_record/base.rb activerecord/lib/active_record/persistence.rb
| * | | | | | | | ActiveRecord::Base.joins should allow single nil argument [#6181 state:resolved]Piotr Sarnacki2010-12-161-0/+4
| | | | | | | | |
| * | | | | | | | Replace rudimentary named_scope with scope. [#6052 state:resolved]Pavel Gorbokon2010-12-151-3/+3
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rename method names (actually in tests) * rename instance variable @_named_scopes_cache to @_scopes_cache * rename references in doc comments * don't touch CHANGELOG :)
| * | | | | | | Do not send id for quoting twice if the primary key is string.Neeraj Singh2010-11-231-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [#6022 state:resolved]
* | | | | | | | Update number of queries executed instead of avoiding IM.Emilio Tagua2010-11-191-9/+5
| | | | | | | |
* | | | | | | | IdentityMap - Tests for IMMarcin Raczkowski2010-11-191-0/+6
|/ / / / / / /
* | | | | | | testing multiple ORd queriesAaron Patterson2010-11-181-0/+12
| | | | | | |
* | | | | | | When use where more than once on the same column, relation doesn't do an ↵Santiago Pastorino2010-11-171-0/+9
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | 'or' or 'in' with the values
* | | | | | support finding by a ruby class [#5979 state:resolved]Aaron Patterson2010-11-151-0/+7
| | | | | |
* | | | | | adding more test coverage around finding with active record objectsAaron Patterson2010-11-151-0/+12
| | | | | |
* | | | | | use quoted id of single AR::Base objects in predicatesAaron Patterson2010-11-151-0/+6
| | | | | |