aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
Commit message (Collapse)AuthorAgeFilesLines
* remove some commented-out cruftRick Olson2006-03-161-4/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3898 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use association's :conditions when eager loading. [jeremyevans0@gmail.com] ↵Rick Olson2006-03-161-2/+6
| | | | | | closes #4144 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3897 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added option inheritance for find calls on has_and_belongs_to_many and ↵David Heinemeier Hansson2005-12-131-1/+3
| | | | | | | | has_many assosociations [DHH] Added option to specify :group, :limit, :offset, and :select options from find on has_and_belongs_to_many and has_many assosociations [DHH] Added form_remote_for (form_for meets form_remote_tag) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3287 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added preliminary support for join models [DHH] Added preliminary support ↵David Heinemeier Hansson2005-12-031-36/+34
| | | | | | 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
* has_and_belongs_to_many: use JOIN instead of LEFT JOIN. References #2937.Jeremy Kemper2005-11-211-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3155 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added :include as an option for association declarations [DHH]David Heinemeier Hansson2005-11-061-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2898 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r2915@asus: jeremy | 2005-11-06 05:02:53 -0800Jeremy Kemper2005-11-061-1/+1
| | | | | | | Rename Base.constrain to Base.with_scope so it doesn't conflict with existing concept of database constraints. Make scoping more robust: uniform method => parameters, validated method names and supported finder parameters, raise exception on nested scopes. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2888 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added extension capabilities to has_many and has_and_belongs_to_many proxies ↵David Heinemeier Hansson2005-11-041-0/+10
| | | | | | [DHH] Added find_or_create_by_X as a second type of dynamic finder that'll create the record if it doesn't already exist [DHH] Added constrain scoping for creates using a hash of attributes bound to the :creation key [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* HABTM finder sets :readonly => false. Closes #2525.Jeremy Kemper2005-10-201-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2694 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Parenthesize :conditionsJeremy Kemper2005-10-181-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* DRYed up Associations#clear. Closes #1906 [Caleb]Tobias Lütke2005-10-141-20/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2580 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed various problems with has_and_belongs_to_many when using customer ↵David Heinemeier Hansson2005-09-131-6/+5
| | | | | | finder_sql #2094 [Florian Weber] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2233 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use the inflector rules made for the purposeDavid Heinemeier Hansson2005-09-111-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2186 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Dont be ambigious about the condition keyDavid Heinemeier Hansson2005-07-221-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1896 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added support for calling constrained class methods on has_many and ↵David Heinemeier Hansson2005-07-221-42/+36
| | | | | | has_and_belongs_to_many collections #1764 [Tobias Luetke] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1894 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow unspecified join-table columns to use to their default values when ↵Jamis Buck2005-07-181-2/+4
| | | | | | adding to a habtm collection git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1860 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed incompatibility in DB2 adapter with the new limit/offset approach ↵David Heinemeier Hansson2005-07-171-2/+2
| | | | | | #1718 [Maik Schmidt] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1850 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added callbacks on push_with_attributes #1594 [Florian Weber]David Heinemeier Hansson2005-07-051-0/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1698 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that has_and_belongs_to_many didn't respect single table inheritance ↵David Heinemeier Hansson2005-07-031-0/+9
| | | | | | types #1081 [Florian Weber] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1641 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that adding a record to a has_and_belongs_to collection would always ↵David Heinemeier Hansson2005-06-181-1/+3
| | | | | | save it -- now it only saves if its a new record #1203 [Alisdair McDiarmid] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1453 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r1307@iwill: jeremy | 2005-06-13 19:05:00 -0700Jeremy Kemper2005-06-131-1/+1
| | | | | | | | | | | | | | | Ticket 1312 - Malformed habtm finder sql r1308@iwill: jeremy | 2005-06-13 19:58:48 -0700 Add a habtm with an unquoted condition to Project. r1309@iwill: jeremy | 2005-06-13 19:59:46 -0700 Space out habtm finder conditions. r1310@iwill: jeremy | 2005-06-13 20:00:16 -0700 Test habtm.find with quoted and unquoted conditions. r1311@iwill: jeremy | 2005-06-13 20:00:25 -0700 Update changelog git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1414 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that :delete_sql in has_and_belongs_to_many associations couldn't ↵David Heinemeier Hansson2005-05-191-2/+2
| | | | | | access record properties #1299 [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1313 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Order by is no longer a guarenteeDavid Heinemeier Hansson2005-04-141-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1164 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Qualify the ids used such that eager loading can avoid ambigious keysDavid Heinemeier Hansson2005-04-131-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1163 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Removed the default order by id on has_and_belongs_to_many queries as it ↵David Heinemeier Hansson2005-04-131-7/+13
| | | | | | could kill performance on large sets (you can still specify by hand with :order) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1162 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* No conditions relevant hereDavid Heinemeier Hansson2005-04-111-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1145 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Optimized the SQL used to generate has_and_belongs_to_many queries by ↵David Heinemeier Hansson2005-02-221-1/+1
| | | | | | listing the join table first #693 [yerejm] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@741 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added that has_and_belongs_to_many associations with additional attributes ↵David Heinemeier Hansson2005-01-241-13/+24
| | | | | | also can be created between unsaved objects and only committed to the database when Base#save is called on the associator #524 [Eric Anderson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@484 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added support for associating unsaved objects #402 [Tim Bates]David Heinemeier Hansson2005-01-151-21/+34
| | | | | | | | | 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 conditions in has_many and has_and_belongs_to_many should be ↵David Heinemeier Hansson2005-01-071-1/+1
| | | | | | interpolated just like the finder_sql is git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@344 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added that Base#find takes an optional options hash, including :conditions. ↵David Heinemeier Hansson2005-01-011-10/+36
| | | | | | Base#find_on_conditions deprecated in favor of #find with :conditions #407 [bitsweat] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@305 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that Base.table_name would expect a parameter when used in ↵David Heinemeier Hansson2004-12-221-1/+1
| | | | | | has_and_belongs_to_many joins [Anna Lissa Cruz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@244 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that has_and_belongs_to_many would generate bad sql when naming ↵David Heinemeier Hansson2004-12-141-4/+4
| | | | | | conventions differed from using vanilla "id" everywhere [RedTerror] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@152 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed value quoting in all generated SQL statements, so that integers are ↵David Heinemeier Hansson2004-12-071-6/+7
| | | | | | 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
* Fixed has_and_belongs_to_many guessing of foreign key so that keys are ↵David Heinemeier Hansson2004-12-071-1/+1
| | | | | | generated correctly for models like SomeVerySpecialClient [Florian Weber] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@69 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Silence errors occurring when reloading classesDavid Heinemeier Hansson2004-11-301-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@27 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* InitialDavid Heinemeier Hansson2004-11-241-0/+107
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4 5ecf4fe2-1ee6-0310-87b1-e25e094e27de