aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_many_association.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor && simplify count_records.Emilio Tagua2010-11-231-5/+1
|
* Remove explicit return and avoid creating local var.Emilio Tagua2010-11-241-2/+1
|
* Remove explicit return.Emilio Tagua2010-11-241-1/+1
|
* Refactoring: replace the mix of variables like @finder_sql, @counter_sql, ↵Jon Leighton2010-10-301-32/+24
| | | | etc with just a single scope hash (created on initialization of the proxy). This is now used consistently across all associations. Therefore, all you have to do to ensure finding/counting etc is done correctly is implement the scope correctly.
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-4/+4
| | | | 's/[ \t]*$//' -i {} \;)
* removing references to arel constantsAaron Patterson2010-08-131-1/+1
|
* avoiding symbol to proc againAaron Patterson2010-08-131-1/+1
|
* standarizes the use of the article "an" for "SQL" and "SQLite"Xavier Noria2010-08-051-1/+1
|
* splitting a really long line into multiple lines which is easy on eyesNeeraj Singh2010-06-291-1/+5
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Adds title to activerecord/lib/active_record/associations/*Rizwan Reza2010-06-161-0/+1
|
* clean up more warnings, remove unnecessary methods, fix eval line numbers. ↵Aaron Patterson2010-03-161-0/+4
| | | | | | [#4193 state:resolved] Signed-off-by: wycats <wycats@gmail.com>
* 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-1/+1
| | | | has_many#delete_records
* Rename Model.conditions and relation.conditions to .wherePratik Naik2009-12-261-1/+1
|
* Revert "Split arel_table into method to get a relation and another to ↵Jeremy Kemper2009-11-131-1/+1
| | | | | | 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-1/+1
| | | | default relation.
* Arel::In -> Arel::Predicates::InJeremy Kemper2009-11-021-1/+1
|
* has_many nullify associations keys using ARel.Emilio Tagua2009-08-181-9/+9
|
* Fix that counter_cache breaks with has_many :dependent => :nullify.Gabe da Silveira2009-08-091-0/+1
| | | | | | [#1196 state:committed] 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>
* Providing support for :inverse_of as an option to associations.Murray Steele2009-05-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | You can now add an :inverse_of option to has_one, has_many and belongs_to associations. This is best described with an example: class Man < ActiveRecord::Base has_one :face, :inverse_of => :man end class Face < ActiveRecord::Base belongs_to :man, :inverse_of => :face end m = Man.first f = m.face Without :inverse_of m and f.man would be different instances of the same object (f.man being pulled from the database again). With these new :inverse_of options m and f.man are the same in memory instance. Currently :inverse_of supports has_one and has_many (but not the :through variants) associations. It also supplies inverse support for belongs_to associations where the inverse is a has_one and it's not a polymorphic. Signed-off-by: Murray Steele <muz@h-lame.com> Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fixed that autosave should validate associations even if master is invalid ↵David Heinemeier Hansson2009-02-271-2/+2
| | | | [#1930 status:committed]
* Merge with docrails. Also add a rake task to generate guides in your rails ↵Pratik Naik2008-10-211-0/+1
| | | | | | | | application : rake doc:guides The rake task will generate guides inside doc/guides directory of your application. Open index.html to browse.
* Update the documentation to reflect the change handling :group earlierMichael Koziarski2008-09-161-1/+4
|
* Merge docrailsPratik Naik2008-09-031-0/+14
|
* 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