aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures
Commit message (Collapse)AuthorAgeFilesLines
...
* | Respect the :primary_key option on the through_reflection of (non-nested) ↵Jon Leighton2010-10-191-0/+6
| | | | | | | | through associations
* | Properly support conditions on any of the reflections involved in a nested ↵Jon Leighton2010-10-193-0/+46
| | | | | | | | through association
* | Add test_has_one_through_has_one_through_with_belongs_to_source_reflectionJon Leighton2010-10-143-1/+13
| |
* | Added ↵Jon Leighton2010-10-141-0/+6
| | | | | | | | test_has_many_through_has_many_with_has_many_through_habtm_source_reflection and make it pass
* | First bit of support for habtm in through assocs - ↵Jon Leighton2010-10-132-2/+7
| | | | | | | | test_has_many_through_has_many_with_has_and_belongs_to_many_source_reflection now passes
* | Add a commented, failing test for using a habtm in a has many through ↵Jon Leighton2010-10-121-0/+8
| | | | | | | | association. I want to refactor how aliasing works first.
* | Adding test_has_many_through_has_one_with_has_many_through_source_reflection ↵Jon Leighton2010-10-121-0/+5
| | | | | | | | and modifying ThroughAssociationScope to make it work correctly.
* | Support has_one through assocs as the source associationJon Leighton2010-10-124-6/+14
| |
* | Add support for nested through associations in JoinAssociation. Hence ↵Jon Leighton2010-10-091-0/+14
| | | | | | | | Foo.joins(:bar) will work for through associations. There is some duplicated code now, which will be refactored.
* | Refactoring JoinDependency and friends. This improves the code (IMO) ↵Jon Leighton2010-10-061-0/+6
| | | | | | | | including adding some explanatory comments, but more importantly structures it in such a way as to allow a JoinAssociation to produce an arbitrary number of actual joins, which will be necessary for nested has many through support. Also added 3 tests covering functionality which existed but was not previously covered.
* | Add support for table aliasing, with a test that needs aliasing in order to ↵Jon Leighton2010-10-024-1/+31
| | | | | | | | work correctly. This test incidentally provides a more complicated test case (4 inner joins, 2 using polymorphism).
* | Initial nested_has_many_through support [#1152]Bodaniel Jeanes2010-09-261-0/+2
|/
* order should always be concatenated.Neeraj Singh2010-09-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | order that is declared first has highest priority in all cases. Here are some examples. Car.order('name desc').find(:first, :order => 'id').name Car.named_scope_with_order.named_scope_with_another_order Car.order('id DESC').scoping do Car.find(:first, :order => 'id asc') end No special treatment to with_scope or scoping. Also note that if default_scope declares an order then the order declared in default_scope has the highest priority unless with_exclusive_scope is used. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-147-12/+11
| | | | 's/[ \t]*$//' -i {} \;)
* test and fix collection_singular_ids= with string primary keys [#5125 ↵Robert Pankowecki2010-08-021-1/+1
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* update_attribute should not update readonly attributesNeeraj Singh2010-07-211-0/+1
| | | | | | [#5106 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* string IDs are now quoted correctly [#5064 state:resolved]Will St. Clair + Neeraj Singh2010-07-133-0/+11
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* reset_counter should work with non-traditional belongs_to and polymorphic ↵Neeraj Singh2010-07-081-0/+4
| | | | | | | | belongs_to [#4984 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Test for concatenated orders addedSantiago Pastorino2010-06-261-1/+1
| | | | | | [#4972] Signed-off-by: José Valim <jose.valim@gmail.com>
* Support fixtures for namespaced models [#2965 state:resolved]Andrew White2010-04-252-0/+9
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* fixing invalid yaml [#4424 state:resolved]Aaron Patterson2010-04-171-1/+2
| | | | Signed-off-by: wycats <wycats@gmail.com>
* Refactor compute_type to handle situations where the correct class is ↵Andrew White2010-04-123-0/+11
| | | | | | already loaded Signed-off-by: wycats <wycats@gmail.com>
* Add inverse polymorphic association support. [#3520 state:resolved]George Ogata2009-12-282-1/+9
| | | | Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
* Revert "Revert "Assert primary key does not exist in habtm when the ↵Jeremy Kemper2009-11-231-2/+1
| | | | | | | | | | | | | association is defined, instead of doing that everytime a record is inserted."" This reverts commit 2b82708b0efb3a3458e8177beab58f0c585788ae. [#3128 state:resolved] Conflicts: activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
* Fix has_one with foreign_key and primary_key association bug which caused ↵Graeme Porteous2009-09-121-0/+1
| | | | | | | | the associated object being lost when saving the owner. [#1756 state:resolved] Mixed in a bit from patch by ransom-briggs. [#2813 state:resolved] Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
* Revert "Assert primary key does not exist in habtm when the association is ↵Jeremy Kemper2009-09-021-1/+2
| | | | | | | | | | defined, instead of doing that everytime a record is inserted." Test failures on PostgreSQL. [#3128 state:open] This reverts commit da636809daca9c338200811d3590e446f57c8e81.
* Assert primary key does not exist in habtm when the association is defined, ↵José Valim2009-09-011-2/+1
| | | | | | | | instead of doing that everytime a record is inserted. [#3128 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix that counter_cache breaks with has_many :dependent => :nullify.Gabe da Silveira2009-08-091-0/+3
| | | | | | [#1196 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Revert "Revert "Generate proper :counter_sql from :finder_sql when there is ↵Pratik Naik2009-07-011-0/+8
| | | | | | | | | a newline character immediately following 'SELECT' [#2118 state:resolved]"" This reverts commit 80f1f863cd0f9cba89079511282de5710a2e1832. The feature doesn't work on Postgres, so don't test it on Postgres. Also, Postgres compatibility is irrelevant to the ticket/patch in question.
* Revert "Generate proper :counter_sql from :finder_sql when there is a ↵Yehuda Katz + Carl Lerche2009-06-221-8/+0
| | | | | | | | newline character immediately following 'SELECT' [#2118 state:resolved]" This reverts commit 4851ca9e13a4317342df02ae25b1929340523f7a. The tests do not pass for postgresql.
* Generate proper :counter_sql from :finder_sql when there is a newline ↵Patrick Joyce2009-06-211-0/+8
| | | | | | character immediately following 'SELECT' [#2118 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fixed limited eager loading associations with numbers in the name [#2668 ↵Benjamin Floering2009-05-181-1/+4
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Revert "Fixed bug with polymorphic has_one :as pointing to an STI record"Jeremy Kemper2009-05-112-6/+2
| | | | | | [#2594 state:open] This reverts commit 99c103be1165da9c8299bc0977188ecf167e06a5.
* Providing support for :inverse_of as an option to associations.Murray Steele2009-05-044-0/+46
| | | | | | | | | | | | | | | | | | | | | | You can now add an :inverse_of option to has_one, has_many and belongs_to associations. This is best described with an example: class Man < ActiveRecord::Base has_one :face, :inverse_of => :man end class Face < ActiveRecord::Base belongs_to :man, :inverse_of => :face end m = Man.first f = m.face Without :inverse_of m and f.man would be different instances of the same object (f.man being pulled from the database again). With these new :inverse_of options m and f.man are the same in memory instance. Currently :inverse_of supports has_one and has_many (but not the :through variants) associations. It also supplies inverse support for belongs_to associations where the inverse is a has_one and it's not a polymorphic. Signed-off-by: Murray Steele <muz@h-lame.com> Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fixed bug with polymorphic has_one :as pointing to an STI recordRuy Asan2009-05-012-2/+6
| | | | | | [#2594 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Ensure has_many :through works with changed primary keys [#736 state:resolved]Jim Remsik and Tim Pope2009-03-091-0/+4
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Preload uses exclusive scope [#643 state:resolved]Frederick Cheung2008-12-261-1/+10
| | | | | | | | | With self referential associations, the scope for the the top level should not affect fetching of associations, for example when doing Person.male.find :all, :include => :friends we should load all of the friends for each male, not just the male friends.
* Fix preloading of has_one :through associations on belongs_to [#1507 ↵Matt Jones2008-12-182-1/+9
| | | | | | state:resolved] Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
* fix assignment to has_one :through associations.Matt Jones2008-11-151-0/+5
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Added :constructor and :converter options to composed_of and deprecated the ↵Rob Anderton2008-09-101-1/+10
| | | | | | conversion block 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/+1
| | | | | | many association Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Added missing filesDavid Heinemeier Hansson2008-05-011-0/+12
|
* Ensure table names are quoted by the association preloading code.Frederick Cheung2008-04-262-0/+24
| | | | | | [#45 state:resolved] Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Merge the has_finder gem, renamed as 'named_scope'. Closes #11404 [nkallen]Rick Olson2008-03-241-2/+22
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* has_one :through supports :source_type. Fix up some tests. References #4756.Jeremy Kemper2008-03-221-1/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9075 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add has_one :through support, finally. Closes #4756 [thechrisoshow]Rick Olson2008-03-214-0/+33
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9067 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix that batched :include would pull in duplicate records in some cases. ↵Jeremy Kemper2008-02-281-1/+4
| | | | | | 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/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8933 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make dynamic finders respect the :include on HasManyThrough associations. ↵Michael Koziarski2008-02-181-0/+5
| | | | | | Closes #10998. [cpytel] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8890 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix has_many :through a polymorphic has_many. Closes #10529 [Aleksey ↵Jeremy Kemper2008-02-021-0/+7
| | | | | | Kondratenko] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8776 5ecf4fe2-1ee6-0310-87b1-e25e094e27de