aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_many_association.rb
Commit message (Collapse)AuthorAgeFilesLines
* Refactored AssociationCollection#count for uniformity and Ruby 1.8.7 support.Ernie Miller2008-08-281-26/+0
| | | | | | [#831 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Implement count limit/offset support for has_many associationsTarmo Tänav2008-08-271-1/+10
| | | | | | [#348 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix has_many#count_records. [#865 state:resolved]Xavier Noria2008-08-211-2/+5
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Remove some Symbol#to_proc usage in runtime code. [#484 state:resolved]Cheah Chu Yeow2008-07-091-2/+2
|
* Add has_many :primary_key option to allow setting the primary key on a has ↵Andre Arko2008-07-061-0/+8
| | | | | | many association Signed-off-by: Michael Koziarski <michael@koziarski.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-1/+1
|
* Ensure AssociationCollection#count works with empty condition. [#271 ↵Pratik Naik2008-05-291-1/+1
| | | | state:resolved] [Jan De Poorter]
* Remove duplicate code from associations. [Pratik]Pratik Naik2008-04-061-41/+0
| | | | 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-8/+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-19/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9229 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Merge the has_finder gem, renamed as 'named_scope'. Closes #11404 [nkallen]Rick Olson2008-03-241-1/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* More thoroughly quote table names. Exposes some issues with sqlite2 adapter. ↵Jeremy Kemper2008-01-051-3/+3
| | | | | | 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-2/+2
| | | | | | vars git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8481 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Dynamic finders on association collections respect association :limit. ↵Jeremy Kemper2007-11-211-1/+1
| | | | | | 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
* Allow find on a has_many association defined with :finder_sql to accept id ↵Marcel Molina2007-10-261-1/+1
| | | | | | arguments as strings like regular find does. Closes #9916 [krishna] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8030 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactor association create and build so before & after callbacks behave ↵Jeremy Kemper2007-10-161-7/+1
| | | | | | consistently. Closes #8854. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7935 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Removed unused @join_sql reference (closes #9174) [danger]David Heinemeier Hansson2007-09-221-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7554 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix association writer with :dependent => :nullify. Closes #7314.Jeremy Kemper2007-09-141-8/+11
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7477 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't clobber :includes passed to count on has_many association. Closes ↵Michael Koziarski2007-08-161-1/+1
| | | | | | #9175 [danger] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7326 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make sure has_many associations honour :include when counting. Closes #9167 ↵Michael Koziarski2007-08-161-1/+1
| | | | | | [danger] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7325 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
* Remove deprecated count(conditions=nil, joins=nil) usage. Closes #8993 ↵Rick Olson2007-07-161-1/+1
| | | | | | [lifofifo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7189 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove deprecated find_first and find_all.Jeremy Kemper2007-06-111-19/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6998 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Simplify association proxy implementation by factoring construct_scope out ↵Jeremy Kemper2006-11-191-20/+6
| | | | | | 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-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5359 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* The has_many create method works with polymorphic associations. Closes #6361.Jeremy Kemper2006-10-081-4/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5230 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation: count class method should be called with an options hash rather ↵Jeremy Kemper2006-09-261-1/+1
| | | | | | than two args for conditions and joins. Closes #6287. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5192 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation tests. Remove warnings for dynamic finders and for the foo_count ↵Jeremy Kemper2006-09-151-0/+2
| | | | | | ethod if it's also an attribute. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5116 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Backed out of new_record? to new? transformation as it would screw up ↵David Heinemeier Hansson2006-09-051-2/+2
| | | | | | 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-2/+2
| | | | | | 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
* Rename quote to quote_value so the name can be used in AR models. #3628 [Koz]Michael Koziarski2006-09-041-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5007 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow #count through a has_many association to accept :include. [Dan Peterson]Rick Olson2006-07-241-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4618 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that has_many.create ended up with duplicate objects (closes #5250) ↵David Heinemeier Hansson2006-06-031-1/+1
| | | | | | [daniel@nouvelles-solutions.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4416 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Minor style tweaksDavid Heinemeier Hansson2006-05-211-6/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4355 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that has_many collections shouldn't load the entire association to do ↵David Heinemeier Hansson2006-05-211-2/+27
| | | | | | build or create [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4354 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow :uniq => true with has_many :through associations.Jeremy Kemper2006-05-061-8/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4325 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix the HasManyAssociation#count method so it uses the new ↵Rick Olson2006-04-191-4/+7
| | | | | | ActiveRecord::Base#count syntax, while maintaining backwards compatibility. [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4237 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix HasManyAssociation#find bugs when :finder_sql is set (closes #4600) ↵David Heinemeier Hansson2006-04-061-1/+1
| | | | | | [lagroue@free.fr] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4176 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use association's :conditions when eager loading. [jeremyevans0@gmail.com] ↵Rick Olson2006-03-161-3/+2
| | | | | | closes #4144 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3897 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base.abstract_class? that marks which classes are not part of the ↵Rick Olson2006-03-161-1/+1
| | | | | | Active Record hierarchy. closes #3704 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3882 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* save polymorphic joins from the has_many|one association (closes #3812) ↵David Heinemeier Hansson2006-02-121-2/+2
| | | | | | [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3586 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Using AssociationCollection#build with arrays of hashes should call build, ↵David Heinemeier Hansson2006-02-031-1/+1
| | | | | | not create [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3525 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix .count for has_many associations with multi-line finder-sql. Closes #3540 Michael Koziarski2006-01-211-1/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3450 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added option inheritance for find calls on has_and_belongs_to_many and ↵David Heinemeier Hansson2005-12-131-9/+8
| | | | | | | | 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-53/+52
| | | | | | 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
* Work-in progress for providing better join model support and polymorphic ↵David Heinemeier Hansson2005-12-021-7/+14
| | | | | | associations git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3209 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add :group option, correspond to GROUP BY, to the find method and to the ↵Jeremy Kemper2005-11-101-1/+2
| | | | | | has_many association. Closes #2818. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2974 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added :include as an option for association declarations [DHH]David Heinemeier Hansson2005-11-061-5/+15
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2898 5ecf4fe2-1ee6-0310-87b1-e25e094e27de