aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
Commit message (Collapse)AuthorAgeFilesLines
* 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]
* Use schema.rb for all databasesFrederick Cheung2008-04-221-1/+1
| | | | | | Move adapter specific schema into their own files Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Revert "Ensure that save on child object fails for invalid belongs_to ↵Michael Koziarski2008-04-111-12/+0
| | | | | | association. Closes #11555. [rubyruy]" This reverts commit c67e985994362290308073ed2793dd8e7f2a76db.
* Ensure that save on child object fails for invalid belongs_to association. ↵Pratik Naik2008-04-101-0/+12
| | | | | | Closes #11555. [rubyruy] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9247 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Split associations_test.rb into multiple files based on association type. ↵Pratik Naik2008-04-066-0/+2445
| | | | | | [Pratik] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9233 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactor HasManyThroughAssociation to inherit from HasManyAssociation. ↵Pratik Naik2008-04-061-5/+27
| | | | | | Association callbacks and <association>_ids= now work with hm:t. Closes #11516 [rubyruy] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9230 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make HABTM#create behave the same as << with after_add callbacks. Closes ↵Michael Koziarski2008-04-041-0/+15
| | | | | | #11374 [freels] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9224 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add efficient #include? to AssociationCollection (for has_many/has_many ↵Rick Olson2008-04-011-0/+30
| | | | | | :through/habtm). [stopdropandrew] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9200 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make sure ActiveRecord tests can run individually. Closes #11425 ↵Pratik Naik2008-03-281-1/+1
| | | | | | [thechrisoshow, h-lame] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9109 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix issue where the :uniq option of a has_many :through association is ↵Rick Olson2008-03-261-0/+8
| | | | | | ignored when find(:all) is called. Closes #9407 [cavalle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9096 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Merge the has_finder gem, renamed as 'named_scope'. Closes #11404 [nkallen]Rick Olson2008-03-241-4/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add has_one :through support, finally. Closes #4756 [thechrisoshow]Rick Olson2008-03-211-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9067 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that scoped joins would not always be respected (closes #6821) ↵David Heinemeier Hansson2008-03-131-0/+8
| | | | | | [Theory/Danger] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9022 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure that ActiveRecord::Calculations disambiguates field names with the ↵Rick Olson2008-03-131-0/+8
| | | | | | table name. Closes #11027 [cavalle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9018 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Improve performance by avoiding named block arguments. Closes #11109 [adymo]Michael Koziarski2008-02-291-0/+5
| | | | | | | Reapplies [8865] with some fixes git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8957 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Provide a post title for sqlite3Jeremy Kemper2008-02-281-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8943 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix that batched :include would pull in duplicate records in some cases. ↵Jeremy Kemper2008-02-281-0/+26
| | | | | | Closes #11215 [Catfish] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8942 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix preloading nil polymorphic belongs_to. Closes #11218 [matrix9180]Jeremy Kemper2008-02-271-1/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8933 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove dead code from hmt#delete. Closes #11236 [rubyruy]Jeremy Kemper2008-02-271-0/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8932 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Move the eager load nested include tables into schema.rb and use delete_all ↵Michael Koziarski2008-02-201-64/+38
| | | | | | instead of drop table to reset the state. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8914 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove disconnect! in test case, it causes segfaults on sqlite3 and ↵Michael Koziarski2008-02-201-6/+2
| | | | | | completely destroys postgresql git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8908 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove mysql option from a test that applies to all databases. References ↵Jeremy Kemper2008-02-191-5/+4
| | | | | | #11154. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8897 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't assume all records from nested include are of same class. Closes ↵Jeremy Kemper2008-02-191-0/+114
| | | | | | #11154 [acechase] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8896 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure nested preloading works when associations return nil. Closes #11145 ↵Michael Koziarski2008-02-181-0/+6
| | | | | | [GMFlash] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8894 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make dynamic finders respect the :include on HasManyThrough associations. ↵Michael Koziarski2008-02-181-0/+6
| | | | | | Closes #10998. [cpytel] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8890 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix the pre-quoted table names in the eager tests. [mislav]Michael Koziarski2008-02-111-2/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8857 5ecf4fe2-1ee6-0310-87b1-e25e094e27de