aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations.rb
Commit message (Collapse)AuthorAgeFilesLines
* Changed ActiveRecord to use new callbacks and speed up observers by only ↵José Valim2009-09-081-17/+36
| | | | | | notifying events that are actually being consumed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Revert "Assert primary key does not exist in habtm when the association is ↵Jeremy Kemper2009-09-021-11/+11
| | | | | | | | | | 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-12/+12
| | | | | | | | instead of doing that everytime a record is inserted. [#3128 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Enable has_many :through for going through a has_one association on the join ↵Gabe da Silveira2009-08-101-2/+29
| | | | | | model [#2719 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Changed to use klass instead of constantizing in assign_ids generated methodDmitry Ratnikov2009-08-091-1/+1
| | | | | | [#260 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix for nested :include with namespaced models.Rich Bradley2009-08-091-1/+1
| | | | [#260 state:committed]
* Merge docrailsPratik Naik2009-07-251-5/+71
|
* Add primary_key option to belongs_to associationSzymon Nowak2009-07-151-3/+6
| | | | | | [#765 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Use map! instead of map for <association>_idsPratik Naik2009-07-131-2/+2
|
* Optimize <association>_ids for hm:t with belongs_to sourcePratik Naik2009-07-131-1/+8
|
* HasOneThroughAssociation still shouldn't derive from HasManyThroughAssociation.Adam Milligan2009-06-121-7/+2
| | | | | | [#1642 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Break up DependencyModule's dual function of providing a "depend_on" DSL and ↵Joshua Peek2009-05-281-1/+1
| | | | "included" block DSL into separate modules. But, unify both approaches under AS::Concern.
* Fixed limited eager loading associations with numbers in the name [#2668 ↵Benjamin Floering2009-05-181-1/+1
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Cherry-pick core extensionsJeremy Kemper2009-05-131-0/+2
|
* Use DependencyModule for included hooks in ActiveRecordBryan Helmkamp2009-05-111-4/+2
|
* Fixed eager load error on find with include => [:table_name] and hash ↵Anthony Crumley2009-05-101-4/+16
| | | | | | conditions like {:table_name => {:column => 'value'}} Signed-off-by: Michael Koziarski <michael@koziarski.com>
* honour :inverse_of for joins based includeFrederick Cheung2009-05-101-2/+8
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Providing support for :inverse_of as an option to associations.Murray Steele2009-05-041-3/+9
| | | | | | | | | | | | | | | | | | | | | | 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>
* Ensure :dependent => :delete_all works for association with hash conditionsPratik Naik2009-04-201-1/+1
|
* Ensure JoinAssociation uses aliased table name when multiple associations ↵Pratik Naik2009-04-201-1/+1
| | | | have hash conditions on the same table
* Added :touch option to belongs_to associations that will touch the parent ↵David Heinemeier Hansson2009-04-161-23/+45
| | | | record when the current record is saved or destroyed [DHH]
* Ensure NoMethodError isn't raised when some of the nested eager loaded ↵Murray Steele2009-03-121-4/+9
| | | | | | associations are empty [#1696 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix RDoc grammar and ensure hm:t tests can run in isolation. [#1644 ↵Adam Milligan2009-03-071-1/+1
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure belongs_to association with a counter cache in name spaced model ↵Adam Cooper2009-03-061-3/+1
| | | | | | works [#1678 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure self referential HABTM associations raise an exception if ↵Tom Lea2009-03-061-0/+10
| | | | | | association_foreign_key is missing. [#1252 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Force all internal calls to Array#to_sentence to use English [#2010 ↵David Heinemeier Hansson2009-02-271-1/+1
| | | | state:resolved]
* Fixed that autosave should validate associations even if master is invalid ↵David Heinemeier Hansson2009-02-271-118/+2
| | | | [#1930 status:committed]
* Merge with docrailsPratik Naik2009-02-241-36/+29
|
* Merge docrails along with the new guides and guides generation codePratik Naik2009-02-061-0/+16
|
* Merge docrailsPratik Naik2009-02-011-4/+5
|
* Add support for nested object forms to ActiveRecord and the helpers in ↵Eloy Duran2009-02-011-43/+48
| | | | | | | | ActionPack Signed-Off-By: Michael Koziarski <michael@koziarski.com> [#1202 state:committed]
* Make belongs_to :dependent => :destroy destroy self before associated ↵Ben VandenBos2009-01-161-2/+2
| | | | | | | | object [#1079 state:resolved] If foreign key constraints are in place then deleteing the associated object first will cause a foreign key violation Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
* Merge commit 'fred/pullable'Pratik Naik2008-12-301-2/+2
|\
| * Fix to_sentence being used with options removed by 273c77Frederick Cheung2008-12-271-1/+1
| |
| * Fix :include of has_many associations with :primary_key optionFrederick Cheung2008-12-261-1/+1
| |
* | Inline code comments for class_eval/module_eval [#1657 state:resolved]Xavier Noria2008-12-281-18/+18
|/ | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix configure_dependency_for_has_many not quoting conditions properly [#1461 ↵Frederick Cheung2008-12-211-3/+3
| | | | state:resolved]
* Fix has many through not quoting table names [#1163 state:resolved]Karthik Krishnan2008-12-201-1/+1
| | | | Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
* Merge docrailsPratik Naik2008-12-191-5/+5
|
* Don't include table_name twiceFrederick Cheung2008-12-181-1/+1
|
* Ensure :include checks joins when determining if it can preload [#528 ↵Frederick Cheung2008-12-181-10/+33
| | | | state:resolved]
* Add :having option to find, to use in combination with grouped finds. Also ↵miloops2008-12-011-4/+8
| | | | | | | added to has_many and has_and_belongs_to_many associations. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1028 state:committed]
* Ensure hash conditions on referenced tables are considered when eager ↵Paul2008-11-261-0/+1
| | | | | | loading with limit/offset. [#1404 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Autoload ActiveRecord filesJoshua Peek2008-11-241-10/+12
|
* Added :counter_sql as a valid key for habtm associationsTekin Suleyman2008-11-071-1/+1
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Merge docrails. Remove unnecessary files.Pratik Naik2008-11-021-0/+8
|
* Make sure habtm use class variable to list association valid keysLuca Guidi2008-11-011-9/+12
| | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1310 state:committed]
* Skip collection ids reader optimization if using :finder_sqlJeremy Kemper2008-10-231-1/+1
|
* Merge with docrails. Also add a rake task to generate guides in your rails ↵Pratik Naik2008-10-211-1/+2
| | | | | | | | application : rake doc:guides The rake task will generate guides inside doc/guides directory of your application. Open index.html to browse.
* Remove the functionality introduce in 28d3390Michael Koziarski2008-10-101-12/+1
| | | | There are several situations it doesn't cater for, and the inconsistency isn't worth blocking 2.2.