aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/reflection.rb
Commit message (Collapse)AuthorAgeFilesLines
* Change belongs_to so that the foreign_key assumption is taken from the ↵Rick Olson2007-07-161-1/+1
| | | | | | association name, not the class name. Closes #8992 [hasmanyjosh] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7188 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow a polymorphic :source for has_many :through associations. Closes ↵Rick Olson2007-03-131-2/+6
| | | | | | #7143 [protocool] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6408 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Aggregate reflection klass works with nested :class_nameJeremy Kemper2007-01-141-35/+32
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5923 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* [DOCS] Apply more documentation for ActiveRecord Reflection. Closes #4055 ↵Rick Olson2007-01-051-5/+19
| | | | | | [Robby Russell] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5855 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* fix association exception messages, fix them so the error messages actually ↵Rick Olson2006-07-201-2/+2
| | | | | | display git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4615 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Reflect on aggregation ignores :class_name option (fixes #4599) [lars pind]David Heinemeier Hansson2006-04-061-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4175 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added descriptive error messages for invalid has_many :through associations: ↵Rick Olson2006-04-051-0/+4
| | | | | | | | | 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
* pass the correct reflection to HasManyThroughAssociationPolymorphicErrorRick Olson2006-03-301-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4106 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Change has_many :through to use the :source option to specify the source ↵Rick Olson2006-03-241-6/+3
| | | | | | association. :class_name is now ignored. [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4022 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow has_many :through associations to find the source association by ↵Rick Olson2006-03-191-7/+12
| | | | | | 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
* Allow has_many :through to work on has_many associations (closes #3864) ↵Rick Olson2006-03-191-2/+4
| | | | | | [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-0/+31
| | | | | | :through or :include (closes #4226) [josh@hasmanythrough.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3961 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix that has_many :through honors the foreign key set by the belongs_to ↵Rick Olson2006-03-181-0/+6
| | | | | | 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
* Allow :dependent options to be used with polymorphic joins. #3820 [Rick Olson]Rick Olson2006-03-161-3/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3881 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make counter cache work when replacing an association (closes #3245). Thanks ↵Jamis Buck2006-03-041-0/+8
| | | | | | for the patch! git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3762 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add more documentation for Reflection. [robby@planetargon.com]. Closes #4001Michael Koziarski2006-02-281-1/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3705 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Dont require association classes before theyre supposed to be used (closes ↵David Heinemeier Hansson2006-02-271-4/+0
| | | | | | #3976) [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that reflections would bleed across class boundaries in single-table ↵David Heinemeier Hansson2006-02-251-2/+4
| | | | | | inheritance setups (closes #3796) [lars@pind.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3650 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Reflections don't attempt to resolve module nesting of association classes. ↵Jeremy Kemper2006-02-221-3/+2
| | | | | | Simplify type computation. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3637 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added option to Base.reflection_of_all_associations to specify a specific ↵David Heinemeier Hansson2005-12-271-3/+5
| | | | | | association to scope the call. For example Base.reflection_of_all_associations(:has_many) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3357 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added preliminary support for join models [DHH] Added preliminary support ↵David Heinemeier Hansson2005-12-031-38/+48
| | | | | | 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
* Made association extensions use simpler block syntaxDavid Heinemeier Hansson2005-11-061-4/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2895 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix docs (closes #2491)David Heinemeier Hansson2005-10-261-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2744 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r2979@asus: jeremy | 2005-07-10 01:51:00 -0700Jeremy Kemper2005-07-101-30/+32
| | | | | | | | | | | | | Split association reflection test into has_many and has_one tests. TODO: extend to belongs_to and habtm as well. Kill trailing whitespace. r2980@asus: jeremy | 2005-07-10 01:53:41 -0700 Test that eager load of firm.account (a has_one) returns the correct account. This doesn't cover the regression in Ticket #1688, however. Need a case where class name is not provided and the singular name is over-singularized by active_record.class_name. Kill trailing whitespace. r2981@asus: jeremy | 2005-07-10 01:56:44 -0700 Fix class name resolution in AssociationReflection#name_to_class_name. Use the equivalent of the idiomatic ||= (read or write if nil) for the class_inheritable_attribute reflection arrays. Kill trailing whitespace. r2982@asus: jeremy | 2005-07-10 01:59:08 -0700 Remove superfluous assignment in compute_type. In an inject, the return value is used for the next injection, so assigning to the injected value is unnecessary. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1790 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Speeded up eager loading a whole bunchDavid Heinemeier Hansson2005-04-181-1/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1212 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added MacroReflection#macro which will return a symbol describing the macro ↵David Heinemeier Hansson2005-02-271-4/+10
| | | | | | used (like :composed_of or :has_many) #718, #248 [james@slashetc.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@805 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* InitialDavid Heinemeier Hansson2004-11-241-0/+126
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4 5ecf4fe2-1ee6-0310-87b1-e25e094e27de