aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Make sure associated has_many/habtm objects get saved even when :validate => ↵Jan De Poorter2008-06-271-1/+18
| | | | | | false is used. [#486 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* fix mergerick2008-06-194-4/+57
|\
| * Fix quoting in test_counting_with_single_conditionsJeremy Kemper2008-06-111-1/+1
| |
| * Added some has_many testsJan De Poorter2008-06-111-3/+3
| | | | | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
| * Add :validate option to associations. [#301 state:resolved]Jan De Poorter2008-06-113-0/+42
| | | | | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
| * Fix conditions and order on join tables with limited eager loading. [#372 ↵Tiago Macedo2008-06-081-1/+12
| | | | | | | | state:resolved]
* | fix eager loading with dynamic findersBrandon Keepers2008-06-092-0/+12
|/
* belongs_to polymorphic association assignments update the foreign_id and ↵Tim Harper2008-05-311-1/+28
| | | | | | | | | | | foreign_type fields regardless of whether the record being assigned is new or not. fixes the following scenarios: * I have validates_inclusion_of on the type field for a polymorphic belongs_to association. I assign a new record to the model's polymorphic relationship of the proper type. validation fails because the type field has not been updated. * I replace the value for a ppolymorphic association to a new record of another class. The type field still says its the previous class, and the id field points to the previous record as well. [#191 state:closed]
* Ensure query assertion counts are the same when partial updates are enabledJeremy Kemper2008-05-302-0/+3
|
* Ensure AssociationCollection#count works with empty condition. [#271 ↵Pratik Naik2008-05-291-0/+4
| | | | state:resolved] [Jan De Poorter]
* Fix faulty tests introduced in 8d0b4fa39Michael Koziarski2008-05-241-1/+1
|
* Added :select option to has_one and belongs_to, remove unused :order option ↵josevalim2008-05-242-0/+10
| | | | | | | on belongs_to. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#241 state:resolved]
* Add first/last methods to associations/named_scope. [#226 state:resolved]Ryan Bates2008-05-203-0/+70
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Don't rely on association proxying object_id. [#225 state:resolved]Jeremy Kemper2008-05-191-2/+2
|
* When preloading group by reflection rather than by class [#125 state:resolved]Frederick Cheung2008-05-111-0/+6
| | | | | | | | This avoids extra queries when several subclasses inherit the association from their parent class, while still coping with subclasses redefining associations. Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix blank conditions on AssociationCollection#find. [#104 state:resolved]Jonathan Viney2008-05-111-1/+7
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure hm:t preloading honours reflection options. [#137 state:resolved]Frederick Cheung2008-05-111-0/+11
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure correct record is returned when preloading has_one where more than ↵Frederick Cheung2008-05-061-0/+4
| | | | | | | one row exists Signed-off-by: Michael Koziarski <michael@koziarski.com> [#73 state:closed]
* Fix failing associate_with_create tests inserting null first_nameJeremy Kemper2008-05-011-3/+3
|
* Merge branch 'master' of git@github.com:rails/railsDavid Heinemeier Hansson2008-05-011-1/+22
|\
| * Fixed AssociationsPreload such that it doesnt require foreign keys to be ↵David Heinemeier Hansson2008-04-301-1/+22
| | | | | | | | integers (fcheung) [#33 state:resolved]
* | best solution?Steven Soroka2008-05-011-0/+12
|/ | | | Signed-off-by: Steven Soroka <ssoroka78@gmail.com>
* Ensure table names are quoted by the association preloading code.Frederick Cheung2008-04-261-1/+27
| | | | | | [#45 state:resolved] Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Fixes a subtle bug when using symbols for key definitions in habtm associationsDavid Dollar2008-04-231-0/+29
|
* Fix include? on has_many collections with finder_sql to fall back to Array ↵Joshua Bates2008-04-231-0/+11
| | | | | | include? rather than try to use SQL. [#18 state:resolved]