aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
Commit message (Collapse)AuthorAgeFilesLines
* save(false) is gone, use save(:validate => false) instead.José Valim2010-01-171-1/+1
|
* Use Arel::Table instead of ActiveRecord::Relation from HABTM and ↵Pratik Naik2010-01-011-3/+3
| | | | has_many#delete_records
* Add Relation#delete [Pratik Naik, Emilio Tagua]Pratik Naik2010-01-011-1/+1
|
* Rename Model.conditions and relation.conditions to .wherePratik Naik2009-12-261-1/+1
|
* Revert "Revert "Assert primary key does not exist in habtm when the ↵Jeremy Kemper2009-11-231-13/+1
| | | | | | | | | | | | | association is defined, instead of doing that everytime a record is inserted."" This reverts commit 2b82708b0efb3a3458e8177beab58f0c585788ae. [#3128 state:resolved] Conflicts: activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
* Revert "Split arel_table into method to get a relation and another to ↵Jeremy Kemper2009-11-131-2/+2
| | | | | | memoize the default relation." This reverts commit bd51790895fc75a3b4e19e8dd7aa6dc389d77068.
* Split arel_table into method to get a relation and another to memoize the ↵Jeremy Kemper2009-11-131-2/+2
| | | | default relation.
* Arel::In -> Arel::Predicates::InJeremy Kemper2009-11-021-1/+1
|
* Merge commit 'rails/master'Emilio Tagua2009-09-141-2/+2
|\
| * Fix habtm associations when using multiple databasessdsykes2009-09-121-2/+2
| | | | | | | | | | | | [#3128] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | Merge commit 'rails/master'Emilio Tagua2009-09-081-0/+16
|\| | | | | | | | | Conflicts: activerecord/lib/active_record/associations.rb
| * Revert "Assert primary key does not exist in habtm when the association is ↵Jeremy Kemper2009-09-021-0/+16
| | | | | | | | | | | | | | | | | | | | defined, instead of doing that everytime a record is inserted." Test failures on PostgreSQL. [#3128 state:open] This reverts commit da636809daca9c338200811d3590e446f57c8e81.
* | Merge commit 'rails/master'Emilio Tagua2009-09-011-16/+0
|\| | | | | | | | | Conflicts: activerecord/lib/active_record/associations.rb
| * Assert primary key does not exist in habtm when the association is defined, ↵José Valim2009-09-011-16/+0
| | | | | | | | | | | | | | | | instead of doing that everytime a record is inserted. [#3128 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | habtm insertion with ARel integration.Emilio Tagua2009-08-181-8/+5
| |
* | habtm delete method integrated with ARel.Emilio Tagua2009-08-181-4/+5
|/
* raises an exception on habtm join table inserts if join table contains a ↵Jaime Bellmyer2009-08-091-2/+14
| | | | | | | | primary key. Caches this check to save time on subsequent inserts. [#2086 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* raises exception (ActiveRecord::ConfigurationError with message) on habtm ↵Jaime Bellmyer2009-08-091-0/+4
| | | | | | association creation if join table contains a primary key Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Revert "Revert "Generate proper :counter_sql from :finder_sql when there is ↵Pratik Naik2009-07-011-9/+1
| | | | | | | | | a newline character immediately following 'SELECT' [#2118 state:resolved]"" This reverts commit 80f1f863cd0f9cba89079511282de5710a2e1832. The feature doesn't work on Postgres, so don't test it on Postgres. Also, Postgres compatibility is irrelevant to the ticket/patch in question.
* Revert "Generate proper :counter_sql from :finder_sql when there is a ↵Yehuda Katz + Carl Lerche2009-06-221-1/+9
| | | | | | | | newline character immediately following 'SELECT' [#2118 state:resolved]" This reverts commit 4851ca9e13a4317342df02ae25b1929340523f7a. The tests do not pass for postgresql.
* Generate proper :counter_sql from :finder_sql when there is a newline ↵Patrick Joyce2009-06-211-9/+1
| | | | | | character immediately following 'SELECT' [#2118 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fixed that autosave should validate associations even if master is invalid ↵David Heinemeier Hansson2009-02-271-2/+2
| | | | [#1930 status:committed]
* Cache columns for has_and_belongs_to_many associationslukeludwig2009-01-171-3/+9
| | | | | This avoids repeatedly calling SHOW COLUMNS when the association is queried [#1738 state:committed]
* Refactored AssociationCollection#count for uniformity and Ruby 1.8.7 support.Ernie Miller2008-08-281-0/+10
| | | | | | [#831 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Updated has_and_belongs_to_many association to fix :finder_sql ↵Nathan Witmer2008-08-161-3/+1
| | | | | | interpolation. [#848 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Extract owner_quoted_id so it can be overridden. [#292 state:committed]Andre Arko2008-06-251-3/+3
|
* fix eager loading with dynamic findersBrandon Keepers2008-06-091-0/+1
|
* Fixes a subtle bug when using symbols for key definitions in habtm associationsDavid Dollar2008-04-231-3/+3
|
* Remove duplicate code from associations. [Pratik]Pratik Naik2008-04-061-49/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9231 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactor HasManyThroughAssociation to inherit from HasManyAssociation. ↵Pratik Naik2008-04-061-4/+0
| | | | | | Association callbacks and <association>_ids= now work with hm:t. Closes #11516 [rubyruy] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9230 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure HABTM#create and HABTM#build do not load entire association. [Pratik]Pratik Naik2008-04-051-2/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9229 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make HABTM#create behave the same as << with after_add callbacks. Closes ↵Michael Koziarski2008-04-041-4/+3
| | | | | | #11374 [freels] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9224 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure that modifying has_and_belongs_to_many actions clear the query cache. ↵Rick Olson2008-01-181-5/+5
| | | | | | Closes #10840 [john.andrews] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8653 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* More thoroughly quote table names. Exposes some issues with sqlite2 adapter. ↵Jeremy Kemper2008-01-051-4/+4
| | | | | | Closes #10698. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: fix warnings, shadowed block vars, and unitialized instance ↵Jeremy Kemper2007-12-221-8/+8
| | | | | | vars git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8481 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that habtm associations should be able to set :select as part of their ↵David Heinemeier Hansson2007-12-051-2/+2
| | | | | | definition and have that honored [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8313 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Dynamic finders on association collections respect association :limit. ↵Jeremy Kemper2007-11-211-1/+5
| | | | | | Closes #10227 [Jack Danger Canty] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8178 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make Dynamic Finders on Association Collections Respect Association :order ↵Michael Koziarski2007-11-211-1/+1
| | | | | | [patrick.t.joyce, technoweenie]. Closes #10211 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8174 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactor association create and build so before & after callbacks behave ↵Jeremy Kemper2007-10-161-21/+16
| | | | | | consistently. Closes #8854. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7935 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed spelling errors (closes #9706) [tarmo/rmm5t]David Heinemeier Hansson2007-09-281-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Stop users from calling .create on a has_many / habtm association when the ↵Michael Koziarski2007-09-181-2/+19
| | | | | | owner is a new_record? git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7511 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Formatting, grammar and spelling fixes for the associations documentation. ↵Michael Koziarski2007-08-281-3/+3
| | | | | | [seanhussey] Closes #8899 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7368 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make habtm respect the :select option. Closes #9207. [Aleksey Kondratenko]Michael Koziarski2007-08-071-1/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7279 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactored in use of extract_options! (closes #9079) [josh]David Heinemeier Hansson2007-07-241-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7220 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Move from select * to select tablename.* to avoid clobbering IDs. Closes ↵Michael Koziarski2007-07-071-0/+1
| | | | | | #8889 [dasil003] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7167 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove deprecated push_with_attributes.Jeremy Kemper2007-06-111-22/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6997 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Simplify association proxy implementation by factoring construct_scope out ↵Jeremy Kemper2006-11-191-10/+4
| | | | | | of method_missing. Closes #6643. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5564 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* update deprecations to include alternative methods (where available)Jamis Buck2006-10-241-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5359 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Backed out of new_record? to new? transformation as it would screw up ↵David Heinemeier Hansson2006-09-051-4/+4
| | | | | | existing models that did boolean calls on "new" attributes [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5018 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecated ActiveRecord::Base.new_record? in favor of ↵David Heinemeier Hansson2006-09-051-4/+4
| | | | | | ActiveRecord::Base.new? (old version still works until Rails 2.0) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5017 5ecf4fe2-1ee6-0310-87b1-e25e094e27de