aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations.rb
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup the proxy rollback #492David Heinemeier Hansson2005-01-181-14/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@457 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that the belongs_to and has_one proxy would fail a test like 'if ↵David Heinemeier Hansson2005-01-181-4/+49
| | | | | | project.manager' -- this unfortunately also means that you can't call methods like project.manager.build unless there already is a manager on the project #492 [Tim Bates] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@456 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added support for associating unsaved objects #402 [Tim Bates]David Heinemeier Hansson2005-01-151-164/+164
| | | | | | | | | Added replace to associations, so you can do project.manager.replace(new_manager) or project.milestones.replace(new_milestones) #402 [Tim Bates] Added build and create methods to has_one and belongs_to associations, so you can now do project.manager.build(attributes) #402 [Tim Bates] Fixed that Base#== wouldn't work for multiple references to the same unsaved object #402 [Tim Bates] Added that if a before_* callback returns false, all the later callbacks and the associated action are cancelled. If an after_* callback returns false, all the later callbacks are cancelled. Callbacks are generally run in the order they are defined, with the exception of callbacks defined as methods on the model, which are called last. #402 [Tim Bates] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@417 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that foreign keys named the same as the association would cause stack ↵David Heinemeier Hansson2005-01-111-2/+2
| | | | | | overflow #437 [Eric Anderson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@382 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added a db2 adapter that only depends on the Ruby/DB2 bindings ↵David Heinemeier Hansson2005-01-011-1/+1
| | | | | | (http://raa.ruby-lang.org/project/ruby-db2/) #386 [Maik Schmidt]. Converted all the fixtures to YAML style ones. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@303 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Updated documentation for associations #387 [canadaduane]David Heinemeier Hansson2005-01-011-7/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@299 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Moved support into Active SupportDavid Heinemeier Hansson2004-12-291-56/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@277 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that the const_missing autoload assumes the requested constant is set ↵David Heinemeier Hansson2004-12-281-1/+1
| | | | | | by require_association and calls const_get to retrieve it. If require_association did not set the constant then const_get will call const_missing, resulting in an infinite loop #380 [bitsweat] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@270 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base#clear_association_cache to empty all the cached associations #347 ↵David Heinemeier Hansson2004-12-221-0/+7
| | | | | | [Tobias Luetke] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@252 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deal with associated classes that doesnt reside in their own filesDavid Heinemeier Hansson2004-12-201-1/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@237 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Checked in the proper version of const_missingDavid Heinemeier Hansson2004-12-201-17/+17
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@236 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Forgot a "or" in InflectorDavid Heinemeier Hansson2004-12-201-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@235 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added a require_association hook on const_missing that makes it possible to ↵David Heinemeier Hansson2004-12-201-2/+27
| | | | | | use any model class without requiring it first. Added that Active Record associations are now reloaded instead of cleared to work with the new const_missing hook in Active Record. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@233 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added a better exception for when a type column is used in a table without ↵David Heinemeier Hansson2004-12-141-1/+3
| | | | | | the intention of triggering single-table inheritance. Added that single-table inheritance will only kick in if the inheritance_column (by default "type") is present. Otherwise, inheritance wont have any magic side effects git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed bug with reloading associationsDavid Heinemeier Hansson2004-12-131-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@143 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Moved require_association to associations.rb and added methods for resetting ↵David Heinemeier Hansson2004-12-121-1/+19
| | | | | | the inheritable attributes on subclasses git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@125 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed value quoting in all generated SQL statements, so that integers are ↵David Heinemeier Hansson2004-12-071-3/+3
| | | | | | not surrounded in quotes and that all sanitation are happening through the database's own quoting routine. This should hopefully make it lots easier for new adapters that doesn't accept '1' for integer columns. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@70 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added counter_sql option for has_many associations [bitsweat]David Heinemeier Hansson2004-12-071-1/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@68 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Abolished ActionController::Base.require_or_load in favor of ↵David Heinemeier Hansson2004-11-301-1/+1
| | | | | | require_dependency and ActiveRecord::Base.require_or_load in favor of require_association. Both methods are now also available in the global namespace when you need to require dependencies or associations outside of whats done automatically. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@32 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Silence errors occurring when reloading classesDavid Heinemeier Hansson2004-11-301-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@27 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Keep quiet about failing to load association classes. People know what ↵David Heinemeier Hansson2004-11-261-5/+1
| | | | | | theyre doing. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@16 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* InitialDavid Heinemeier Hansson2004-11-241-0/+576
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4 5ecf4fe2-1ee6-0310-87b1-e25e094e27de