aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations.rb
Commit message (Collapse)AuthorAgeFilesLines
* Limited eager loading no longer ignores scoped :order. Closes #9561 [danger, ↵Marcel Molina2007-10-231-6/+4
| | | | | | josh] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8006 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix regression where the association would not construct new finder SQL on ↵Jeremy Kemper2007-10-161-4/+4
| | | | | | save causing bogus queries for "WHERE owner_id = NULL" even after owner was saved. Closes #8713. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7942 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add notes to documentation regarding attr_readonly behavior with counter ↵Rick Olson2007-10-141-0/+3
| | | | | | caches and polymorphic associations. Closes #9835 [saimonmoore, rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7873 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure that 'autosaving' works when associations aren't loaded [Bryan ↵Michael Koziarski2007-10-101-6/+9
| | | | | | Helmkamp] References #8713 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7824 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Update :dependent docs and improve its argument error message.Jeremy Kemper2007-10-091-34/+32
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7813 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* belongs_to infers the foreign key from the association name instead of from ↵Jeremy Kemper2007-10-081-1/+1
| | | | | | the class name. Fulfills the 1.2.4 deprecation. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7812 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't call attr_readonly on polymorphic belongs_to associations, in case it ↵Rick Olson2007-10-051-1/+1
| | | | | | matches the name of some other non-ActiveRecord class/module. [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7748 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add attr_readonly to specify columns that are skipped during a normal ↵Rick Olson2007-09-301-1/+5
| | | | | | ActiveRecord #save operation. Closes #6896 [dcmanges] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7693 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed spelling errors (closes #9706) [tarmo/rmm5t]David Heinemeier Hansson2007-09-281-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Correctly quote id list for limited eager loading. Closes #7482.Jeremy Kemper2007-09-221-2/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7588 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Associations macros accept extension blocks alongside modules. Closes #9346.Jeremy Kemper2007-09-171-6/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Eager loading respects explicit :joins. Closes #9496.Jeremy Kemper2007-09-151-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7494 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove deprecated functionality from edge rails. Closes #9387 [lifofifo]Michael Koziarski2007-09-031-56/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7402 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Formatting, grammar and spelling fixes for the associations documentation. ↵Michael Koziarski2007-08-281-158/+158
| | | | | | [seanhussey] Closes #8899 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7368 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that eager loading queries and with_scope should respect the :group ↵David Heinemeier Hansson2007-08-211-4/+3
| | | | | | option [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7355 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that eager loading queries should respect the :group option as well [DHH]David Heinemeier Hansson2007-08-211-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7354 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* tiny doc patches [lifo]Rick Olson2007-07-251-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7236 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Change belongs_to so that the foreign_key assumption is taken from the ↵Rick Olson2007-07-161-6/+0
| | | | | | 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
* Define collection singular ids method for has_many :through associations. ↵Jeremy Kemper2007-06-271-2/+3
| | | | | | Closes #8763. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7137 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix polymorphic has_one associations declared in an abstract class. Closes ↵Jeremy Kemper2007-06-251-9/+1
| | | | | | #8638. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7119 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Save associated records only if the association is already loaded. Closes #8713.Jeremy Kemper2007-06-211-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7075 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove deprecated find_first and find_all.Jeremy Kemper2007-06-111-1/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6998 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Quickref for association methods. Closes #7723.Jeremy Kemper2007-05-301-3/+40
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6905 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure that associations with :dependent => :delete_all respect :conditions ↵Rick Olson2007-05-241-4/+5
| | | | | | option. Closes #8034 [danger, joshpeek, Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6827 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix :through docs wrecked up by [6777]. Closes #4961.Jeremy Kemper2007-05-231-1/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6817 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* belongs_to assignment creates a new proxy rather than modifying its target ↵Jeremy Kemper2007-05-221-4/+1
| | | | | | in-place. Closes #8412. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6804 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document deep eager includes. Closes #6267.Jeremy Kemper2007-05-191-1/+9
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6790 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* belongs_to doesn't go :through. Closes #4961.Jeremy Kemper2007-05-181-2/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6777 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Docs: warn that associations names shouldn't be reserved words. Closes #4378.Jeremy Kemper2007-05-181-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6770 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Update documentation for :dependent declaration so that it explicitly uses ↵Marcel Molina2007-05-061-1/+1
| | | | | | the non-deprecated API. Closes #8069. [danger] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6686 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* documentation project patches, closes #7342, #7319, #7316, #7190 ↵Rick Olson2007-03-271-1/+8
| | | | | | [jeremymcanally] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6470 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix method visibility bug uncovered by #7854.Jeremy Kemper2007-03-181-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6442 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* trim the fatRick Olson2007-03-131-44/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6411 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow a polymorphic :source for has_many :through associations. Closes ↵Rick Olson2007-03-131-46/+110
| | | | | | #7143 [protocool] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6408 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Nodoc the irrelevant (from 1.2)David Heinemeier Hansson2007-01-261-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6044 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove useless code in #attribute_present? since 0 != blank?. Closes #7249 ↵Rick Olson2007-01-231-2/+2
| | | | | | [Josh Susser]. Fix minor doc typos. Closes #7157 [Josh Susser] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6018 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix incorrect usage of #classify when creating the eager loading join ↵Rick Olson2007-01-231-5/+5
| | | | | | statement. Closes #7044 [Josh Susser] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6017 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* [DOC] clear up some ambiguity with the way has_and_belongs_to_many creates ↵Rick Olson2007-01-161-1/+7
| | | | | | the default join table name. #7072 [jeremymcanally] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5960 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Improve association documentation, closes #7022. [hasmanyjosh]Michael Koziarski2007-01-151-1/+65
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5939 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* PostgreSQL: use a subselect to correctly perform eager finds with :limit and ↵Jeremy Kemper2007-01-121-1/+7
| | | | | | :order. Closes #4668. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5887 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Subclass instantiation doesn't try to explicitly require the corresponding ↵Jeremy Kemper2006-12-191-4/+0
| | | | | | subclass. Closes #6840. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5751 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* fix faulty inheritance tests and that eager loading grabs the wrong ↵Rick Olson2006-12-191-1/+1
| | | | | | inheritance column when the class of your association is an STI subclass. Closes #6859 [protocool] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5744 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* find supports :lock with :include. Check whether your database allows SELECT ↵Jeremy Kemper2006-12-051-0/+1
| | | | | | ... FOR UPDATE with outer joins before using. Closes #6764. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5682 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Oracle: fix limited id selection for eager loading. Closes #6515.Jeremy Kemper2006-11-101-6/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5480 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Cache inheritance_column. Closes #6592.Jeremy Kemper2006-11-091-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5474 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Find with :include respects scoped :order. Closes #5850.Jeremy Kemper2006-11-071-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5445 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* has_one :dependent => :nullify ignores nil associates. Closes #6528.Jeremy Kemper2006-11-021-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5401 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix has_many :through to add the appropriate conditions when going through ↵Rick Olson2006-10-161-5/+15
| | | | | | an association using STI. Closes #5783. [Jonathan Viney] (sorry, forgot to commit the actual files) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5310 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* automatically add primary key to #select_limited_ids_list order by clause ↵Rick Olson2006-10-131-0/+1
| | | | | | for databases that require order columns in the distinct statements (postgresql) [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5292 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* fix select_limited_ids_list issues in postgresql, retain current behavior in ↵Rick Olson2006-10-131-4/+9
| | | | | | other adapters [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5291 5ecf4fe2-1ee6-0310-87b1-e25e094e27de