aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/associations_join_model_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Pushing a record onto a has_many :through sets the association's foreign key ↵Jeremy Kemper2006-08-201-11/+24
| | | | | | to the associate's primary key and adds it to the correct association. Closes #5829. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4792 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* unbraindeadify addition to has_many :throughJeremy Kemper2006-08-191-0/+13
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4791 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Pushing a record onto a has_many :through sets the association's foreign key ↵Jeremy Kemper2006-08-191-5/+6
| | | | | | to the associate's primary key. Closes #5815. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4790 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add records to has_many :through using <<, push, and concat by creating the ↵Jeremy Kemper2006-08-181-7/+17
| | | | | | association record. Raise if base or associate are new records since both ids are required to create the association. #build raises since you can't associate an unsaved record. #create! takes an attributes hash and creates the associated record and its association in a transaction. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4786 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Calculate sum with SQL, not Enumerable on HasManyThrough Associations. [Dan ↵Rick Olson2006-07-311-0/+4
| | | | | | Peterson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4640 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make more Firebird tests pass (closes #5188) [kennethkunz@gmail.com]David Heinemeier Hansson2006-06-031-1/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4420 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow :uniq => true with has_many :through associations.Jeremy Kemper2006-05-061-7/+12
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4325 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Raise error when trying to add to a has_many :through association. Use the ↵Rick Olson2006-04-251-0/+8
| | | | | | Join Model instead. [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4265 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Support eager includes when going through a polymorphic has_many ↵Rick Olson2006-04-051-1/+1
| | | | | | association. [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4171 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added support for eagerly including polymorphic has_one associations. ↵Rick Olson2006-04-051-0/+16
| | | | | | (closes #4525) [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4170 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added descriptive error messages for invalid has_many :through associations: ↵Rick Olson2006-04-051-0/+16
| | | | | | | | | going through :has_one or :has_and_belongs_to_many [Rick] Added support for going through a polymorphic has_many association: (closes #4401) [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4169 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* regression test for #4206Rick Olson2006-03-281-0/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4086 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed issue that kept :select options from being scoped [Rick]Rick Olson2006-03-261-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4036 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* fix test so that it passesRick Olson2006-03-221-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4009 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow overriding of find parameters in scoped has_many :through calls [Rick ↵Rick Olson2006-03-211-0/+11
| | | | | | Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4007 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* add self referential has_many :through example [Rick]Rick Olson2006-03-211-1/+12
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4006 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't classify the has_one class when eager loading, it is already singular. ↵Rick Olson2006-03-191-0/+7
| | | | | | Add tests. (closes #4117) [jonathan@bluewire.net.nz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3983 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Quit ignoring default :include options in has_many :through calls [Mark James]Rick Olson2006-03-191-1/+26
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3974 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow has_many :through associations to find the source association by ↵Rick Olson2006-03-191-1/+9
| | | | | | setting a custom class (closes #4307) [jonathan@bluewire.net.nz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3973 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Eager Loading support added for has_many :through => :has_many associations ↵Rick Olson2006-03-191-2/+10
| | | | | | (see below). [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3967 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow has_many :through to work on has_many associations (closes #3864) ↵Rick Olson2006-03-191-0/+16
| | | | | | [sco@scottraymond.net] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3964 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Raise error when trying to select many polymorphic objects with has_many ↵Rick Olson2006-03-191-1/+10
| | | | | | :through or :include (closes #4226) [josh@hasmanythrough.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3961 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed has_many :through to include :conditions set on the :through ↵Rick Olson2006-03-181-0/+5
| | | | | | association. closes #4020 [jonathan@bluewire.net.nz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3958 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix that has_many :through honors the foreign key set by the belongs_to ↵Rick Olson2006-03-181-0/+5
| | | | | | association in the join model (closes #4259) [andylien@gmail.com / Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3954 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Nicer error message on has_many :through when :through reflection can not be ↵David Heinemeier Hansson2006-03-181-0/+4
| | | | | | found (closes #4042) [court3nay@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3910 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base.abstract_class? that marks which classes are not part of the ↵Rick Olson2006-03-161-1/+9
| | | | | | Active Record hierarchy. closes #3704 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3882 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow :dependent options to be used with polymorphic joins. #3820 [Rick Olson]Rick Olson2006-03-161-2/+72
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3881 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed eager loading problems with single-table inheritance [Rick Olson] ↵David Heinemeier Hansson2006-03-051-1/+28
| | | | | | Added smarter table aliasing for eager associations for multiple self joins [Rick Olson] (closes #3580) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3776 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make counter_cache work with polymorphic belongs_toJamis Buck2006-03-041-0/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3756 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Improved the Oracle OCI Adapter with better performance for column ↵David Heinemeier Hansson2006-02-211-1/+1
| | | | | | reflection (from #3210), fixes to migrations (from #3476 and #3742), tweaks to unit tests (from #3610), and improved documentation (from #2446) (closes #3879) [Aggregated by schoenm@earthlink.net] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3623 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* save polymorphic joins from the has_many|one association (closes #3812) ↵David Heinemeier Hansson2006-02-121-0/+22
| | | | | | [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3586 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Polymorphic join support for has_one associations (has_one :foo, :as => ↵Jeremy Kemper2006-02-091-1/+10
| | | | | | :bar). Closes #3785. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3558 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* allow has_many :through to work with custom :foreign key (closes #3422) ↵David Heinemeier Hansson2006-01-211-1/+5
| | | | | | [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3456 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add a test to verify correct behavior when creating a polymorphic associationJamis Buck2006-01-201-0/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3440 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Multiple enhancements and adjustments to DB2 adaptor. Closes #3377.Marcel Molina2006-01-041-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3380 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* made .find() and class method delegation work on :through relationsTobias Lütke2005-12-201-0/+18
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3325 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* added :piggyback option to has_many :through relationships to pick up values ↵Tobias Lütke2005-12-201-0/+4
| | | | | | from the join table as needed git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3323 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed :through relations when using STI inherited classes would use the ↵Tobias Lütke2005-12-161-1/+14
| | | | | | inherited class's name as foreign key on the join model git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3315 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added tests for join models and fixed a bug #3177David Heinemeier Hansson2005-12-111-2/+9
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3279 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't use transactional fixtures for when DDL changes are involved.Jeremy Kemper2005-12-041-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3217 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added preliminary support for join models [DHH] Added preliminary support ↵David Heinemeier Hansson2005-12-031-0/+21
for polymorphic associations [DHH] Refactored associations to use reflections to get DRYer, beware, major refactoring -- double check before deploying anything with this (all tests pass, but..) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3213 5ecf4fe2-1ee6-0310-87b1-e25e094e27de