aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_one_through_associations_test.rb
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Merge remote branch 'rails/master' into identity_mapEmilio Tagua2011-02-151-6/+57
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Get rid of set_association_target and association_loaded? as the parts of ↵Jon Leighton2011-01-111-1/+1
| | | | | | | | | | | | the code that need that can now just use association_proxy(:name).loaded?/target=
| | * Allow assignment on has_one :through where the owner is a new record [#5137 ↵Jon Leighton2011-01-031-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | state:resolved] This required changing the code to keep the association proxy for a belongs_to around, despite its target being nil. Which in turn required various changes to the way that stale target checking is handled, in order to support various edge cases (loaded target is nil then foreign key added, foreign key is changed and then changed back, etc). A side effect is that the code is nicer and more succinct. Note that I am removing test_no_unexpected_aliasing since that is basically checking that the proxy for a belongs_to *does* change, which is the exact opposite of the intention of this commit. Also adding various tests for various edge cases and related things. Phew, long commit message!
| | * If a has_many goes :through a belongs_to, and the foreign key of the ↵Jon Leighton2010-12-231-0/+15
| | | | | | | | | | | | belongs_to changes, then the has_many should be considered stale.
| | * Verify that has_one :through preload respects the :conditions [#2976 ↵Will Bryant2010-12-231-0/+12
| | | | | | | | | | | | state:resolved]
| | * Don't allow a has_one association to go :through a collection association ↵Jon Leighton2010-12-231-5/+7
| | | | | | | | | | | | [#2976 state:resolved]
| | * Fix for default_scope tests to ensure comparing of equally sorted listsRaimonds Simanovskis2010-12-231-1/+1
| |/ | | | | | | | | | | This is additional fix for commit ebc47465a5865ab91dc7d058d2d8a0cc961510d7 Respect the default_scope on a join model when reading a through association which otherwise was failing on Oracle (as it returned fixture comments in different order).
| * Respect the default_scope on a join model when reading a through associationJon Leighton2010-12-161-1/+9
| |
* | Merge branch 'master' into nested_has_many_throughJon Leighton2010-12-121-0/+17
|\| | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG 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_through_association.rb
| * test case on has_one :through after a destroyJohn Hawthorn2010-11-291-0/+17
| | | | | | | | | | | | [#6037 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* | Fix naughty trailing whitespaceJon Leighton2010-10-311-6/+6
| |
* | Support for :primary_key option on the source reflection of a through ↵Jon Leighton2010-10-191-3/+9
| | | | | | | | association, where the source is a has_one or has_many
* | Respect the :primary_key option on the through_reflection of (non-nested) ↵Jon Leighton2010-10-191-1/+19
|/ | | | through associations
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-7/+7
| | | | 's/[ \t]*$//' -i {} \;)
* string IDs are now quoted correctly [#5064 state:resolved]Will St. Clair + Neeraj Singh2010-07-131-1/+11
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* This test never runs and it has never run. Since the day this fileNeeraj Singh2010-07-081-4/+0
| | | | | | | | was created this test has name not beginning with test_. Also this test is trying to use has_many on another has_many which is not supported. Signed-off-by: José Valim <jose.valim@gmail.com>
* Allow ho:through#build when the owner is a new record [#1749 state:resolved]Tristan Dunn2009-08-101-0/+10
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* has_one :through should not create a new association when assigned nil [#698 ↵Daniel Guettler2009-05-171-1/+8
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fixed autosave checks on objects with hm:t in :include [#2213 state:resolved]Will Bryant2009-03-121-0/+16
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ruby 1.9 compat: rename deprecated assert_raises to assert_raise.Jeremy Kemper2009-03-081-2/+2
| | | | [#1617 state:resolved]
* Fix preloading of has_one :through associations on belongs_to [#1507 ↵Matt Jones2008-12-181-1/+16
| | | | | | state:resolved] Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
* fix assignment to has_one :through associations.Matt Jones2008-11-151-1/+39
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Ensure methods called on association proxies respect access control. [#1083 ↵Pratik Naik2008-10-131-0/+10
| | | | state:resolved] [Adam Milligan, Pratik]
* 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]
* Load the first and not the last has_one result when doing join-based eager ↵Tarmo Tänav2008-08-251-0/+10
| | | | | | | | | | | 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>
* Split associations_test.rb into multiple files based on association type. ↵Pratik Naik2008-04-061-0/+74
[Pratik] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9233 5ecf4fe2-1ee6-0310-87b1-e25e094e27de