aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
Commit message (Collapse)AuthorAgeFilesLines
* Ensure hash conditions on referenced tables are considered when eager ↵Paul2008-11-261-2/+18
| | | | | | loading with limit/offset. [#1404 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Remove SQL Server cases from tests for latest adapter work to pass rails ↵Ken Collins2008-11-191-1/+1
| | | | | | expected behavior. Signed-off-by: Michael Koziarski <michael@koziarski.com>
* fix assignment to has_one :through associations.Matt Jones2008-11-151-1/+39
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Added tests for HABTM associations with counter_sqlTekin Suleyman2008-11-071-0/+23
| | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1102 state:committed]
* Skip collection ids reader optimization if using :finder_sqlJeremy Kemper2008-10-231-0/+7
|
* Ensure association proxy responds to private class methods defined in ↵Pratik Naik2008-10-161-2/+8
| | | | associated class. [#1083]
* Allow class methods to be sent (via #send) to association proxy (fix for bug ↵Ian White2008-10-161-0/+4
| | | | | | introduced by 691aa20) [#1083] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure methods called on association proxies respect access control. [#1083 ↵Pratik Naik2008-10-133-0/+30
| | | | state:resolved] [Adam Milligan, Pratik]
* Remove the functionality introduce in 28d3390Michael Koziarski2008-10-101-13/+0
| | | | There are several situations it doesn't cater for, and the inconsistency isn't worth blocking 2.2.
* explicitly including child associations that are also included in the parent ↵Will Bryant2008-10-101-1/+41
| | | | | | | association definition should not result in double records in the collection/double loads (#1110) Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1110 state:committed]
* Fix has_many :through when the source is a belongs_to association. [#323 ↵Zach Dennis2008-10-043-1/+26
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* wrote a test showing eager loading's misbehavior (sanitizing against the ↵Will Bryant2008-09-291-0/+7
| | | | | | wrong table) when the association has a :conditions hash Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Make AssociationCollection start transactions in the correct database.Hongli Lai (Phusion)2008-09-233-0/+27
| | | | | | | | | | AssociationCollection now starts transactions by calling AssociationCollection#transaction instead of @owner.transaction or @reflection.klass.transaction. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1081 state:committed]
* Association#first and last should not load the association if not needed. ↵Jan De Poorter2008-09-222-1/+14
| | | | | | [#1091 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* applied patch to fix the associations with blocks in modules bug from an old ↵Adeh DeSandies2008-09-201-0/+15
| | | | trac ticket
* When counting grouped records the target should be loaded to return a valid ↵miloops2008-09-151-0/+2
| | | | | | | | | groups count result. Without this change count_records will group for the count in the query and return erroneous results. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#937 state:committed]
* Support for updating a belongs to association from the foreign key (without ↵Jon Leighton2008-09-131-0/+13
| | | | | | | saving and reloading the record) Signed-off-by: Michael Koziarski <michael@koziarski.com> [#142 state:committed]
* Improve test coverage when using the group option in find, has_many or ↵miloops2008-09-112-0/+17
| | | | | | has_and_belongs_to_many. Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Fix tests that assumed implicit order by idJeremy Kemper2008-08-301-2/+2
|
* Performance: Better query for ASSOCIATION_ids. Select only ids if the ↵miloops2008-08-303-16/+68
| | | | | | association hasn't been loaded. Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Refactored AssociationCollection#count for uniformity and Ruby 1.8.7 support.Ernie Miller2008-08-281-0/+7
| | | | | | [#831 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Implement count limit/offset support for has_many associationsTarmo Tänav2008-08-271-0/+6
| | | | | | [#348 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Alias included associations if needed when doing a countTarmo Tänav2008-08-271-0/+4
| | | | | | [#302 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix two has_one :through errorspivotal2008-08-271-0/+9
| | | | | | | | * Set the association target on assignment; * Reset target to nil on reset, rather than empty array. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#895 state:committed]
* Fix yet another implicit order dependant testTarmo Tänav2008-08-261-3/+3
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* um.. yeahJeremy Kemper2008-08-261-2/+2
|
* typoJeremy Kemper2008-08-261-2/+2
|
* fix tests relying on implicit orderingJeremy Kemper2008-08-251-4/+2
|
* Load the first and not the last has_one result when doing join-based eager ↵Tarmo Tänav2008-08-252-0/+16
| | | | | | | | | | | loading This matters when the has_one is defined with an order in which case there is an expectation that the first one will be loaded. [#904 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Implement old-skool eagerloading for has_one :throughFrederick Cheung2008-08-251-0/+16
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix preloading of has_one through associationsFrederick Cheung2008-08-251-5/+9
| | | | | | [#903 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fixed ordering in ↵Tarmo Tänav2008-08-221-1/+1
| | | | test_find_in_association_with_custom_finder_sql_and_multiple_interpolations
* remember created records and select a random one instead of relying on ↵S. Brent Faulkner2008-08-211-12/+30
| | | | | | sequential id values starting at 1 Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Don't interpret decimals as table names in ↵Peter Wagenet2008-08-211-0/+7
| | | | | | ActiveRecord::Associations::ClassMethods#references_eager_loaded_tables? [#532 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix has_many#count_records. [#865 state:resolved]Xavier Noria2008-08-211-0/+12
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix that has_one natural assignment to already associated record. [#854 ↵Jakub Kuźma2008-08-211-0/+10
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Test for eager loading of STI subclasses from htm associationsTarmo Tänav2008-08-161-0/+7
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Updated has_and_belongs_to_many association to fix :finder_sql ↵Nathan Witmer2008-08-161-0/+7
| | | | | | interpolation. [#848 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fixed STI type condition for eager loading of associationsTarmo Tänav2008-08-161-0/+12
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fixed AssociationCollection#<< resulting in unexpected values in @target ↵Ernie Miller2008-08-081-0/+11
| | | | | | when :uniq => true Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Added missing fixtures for tests which fail to run independently if run ↵Tarmo Tänav2008-08-044-4/+4
| | | | | | after schema reset Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Fix file permissionsTarmo Tänav2008-07-312-0/+0
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Fixed test_joins_with_namespaced_model_should_use_correct_type for postgresqlTarmo Tänav2008-07-311-1/+1
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Fix HasManyThroughAssociationsTest tests. [#733 state:resolved]miloops2008-07-311-3/+6
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Use klass.sti_name to make sure associations take store_full_sti_class into ↵Daniel Guettler2008-07-221-0/+18
| | | | | | account. [#671 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Make sure association preloading works with full STI class name [#465 ↵Joachim Garth2008-07-181-0/+36
| | | | | | state:Resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Add block syntax to HasManyAssociation#build. [#502 state:resolve]Jason Dew2008-07-141-0/+31
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Add support for :primary_key option to has_one as well as has_many so that a ↵Brad Greenlee2008-07-061-0/+7
| | | | | | key other than the default primary key can be used for the association Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Add has_many :primary_key option to allow setting the primary key on a has ↵Andre Arko2008-07-061-0/+4
| | | | | | many association Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Ensure AssociationCollection#size considers all unsaved record. [#305 ↵Pratik Naik2008-07-021-0/+7
| | | | | | state:resolved] [sds] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>