aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/association_collection.rb
Commit message (Collapse)AuthorAgeFilesLines
* While creating a new record using has_many create method default scope of ↵Neeraj Singh2010-08-191-1/+6
| | | | | | | | | | | child should be respected. author.posts.create should take into account default_scope defined on post. [#3939: state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* fixed joining of attributes when using find_or_create_by with multiple ↵Jon Buda2010-07-281-1/+1
| | | | | | attributes through an association Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* No need to check for :uniqNeeraj Singh2010-07-261-6/+3
| | | | | | [#5170 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Make use of tap to return a previously used varSantiago Pastorino2010-07-211-4/+4
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* association load target shouldn't replace recordsSzetobo2010-07-211-3/+4
| | | | | | | | from db if it is already loaded by nested attributes assignment [#5053 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* In nested_attributes when association is not loaded and associationSubba Rao Pasupuleti2010-07-211-1/+8
| | | | | | | | record is saved and then in memory record attributes should be saved [#5053 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Removed warnings when a variable is shadowedŁukasz Strzałkowski2010-07-191-3/+3
|
* Remove unintentional API changes. [#1108]Pratik Naik2010-07-141-9/+4
|
* count method should not take options if it is operated on has_many ↵Neeraj Singh2010-07-131-2/+5
| | | | | | | | association which has finder_sql or counter_sql [#2395 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* fix ActiveRecord `destroy_all` so it returns destroyed recordsMislav Marohnić2010-07-081-3/+4
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Don't remove scheduled destroys when loading an association. [#4642 ↵James Le Cuirot2010-07-011-1/+6
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* AssociationCollection#create_by_*, find_or_create_by_* work properly now. ↵Aaron Patterson2010-06-291-0/+11
| | | | | | [#1108 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Don't define block, just yield if block is given.Emilio Tagua2010-06-241-7/+7
|
* Merge remote branch 'rails/master'Xavier Noria2010-06-201-1/+5
|\ | | | | | | | | Conflicts: actionpack/lib/abstract_controller/base.rb
| * Don't overwrite unsaved updates when loading an association but preserve the ↵James Le Cuirot2010-06-201-1/+5
| | | | | | | | | | | | | | | | order of the loaded records. Reapplied from before but now allows already-saved records to be refreshed. [#4830 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* | Adds title to activerecord/lib/active_record/associations/*Rizwan Reza2010-06-161-0/+2
|/
* Revert "Don't overwrite unsaved updates when loading an association but ↵José Valim2010-06-111-1/+1
| | | | | | | | preserve the order of the loaded records. [#4642 state:open]" This commit introduced a regression described in ticket [#4830]. This reverts commit 0265c708b9696c3943518ad5f3dabdc22c5eba11.
* Don't overwrite unsaved updates when loading an association but preserve the ↵James Le Cuirot2010-06-091-1/+1
| | | | | | order of the loaded records. [#4642 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Properly cache association_collection#scopes calls having argumentsPratik Naik2010-06-041-1/+2
|
* Ensure not to load the entire association when bulk updating existing ↵Pratik Naik2010-04-141-10/+10
| | | | records using nested attributes
* Avoid deprecated String#to_a by using Array.wrap(...) instead of Array(...)Jeremy Kemper2010-04-101-1/+2
|
* Some doc updates reflecting the new query APIPratik Naik2010-04-081-1/+1
|
* Reset named scope cache whenever the @target is resetPratik Naik2010-04-071-2/+9
|
* Memoize association.named_scope callsPratik Naik2010-04-051-0/+3
|
* keep AssociationProxy#to_a to avoid warning in Array(post.author), and ↵Xavier Noria2010-03-121-0/+1
| | | | | | | | delegate it to @target in association collections [#4165 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Get rid of construct_count_options_from_argsPratik Naik2010-01-191-3/+4
|
* Inherit named scope class Scope from RelationPratik Naik2010-01-181-2/+0
|
* Make scopes use relations under the hoodPratik Naik2010-01-161-3/+6
|
* Add Relation#includes to be an equivalent of current finder option :includePratik Naik2010-01-031-1/+1
|
* Get rid of Model.construct_finder_arel_with_includes. Use ↵Pratik Naik2010-01-031-1/+1
| | | | construct_finder_arel instead
* Get rid of DeprecatedCallbacks in ActiveRecord::Associations and finally ↵José Valim2009-12-301-1/+8
| | | | remove it.
* Migrate all the calculation methods to RelationPratik Naik2009-12-291-1/+1
|
* Add Model.having and Relation#havingPratik Naik2009-12-291-1/+1
|
* Add Model.readonly and association_collection#readonly finder methodPratik Naik2009-12-281-1/+1
|
* Add Model.lock and relation#lock now that arel has lockingPratik Naik2009-12-281-1/+1
|
* Add Model.from and association_collection#from finder methodsPratik Naik2009-12-281-1/+1
|
* Rewrite AssociationCollection#find using relationsPratik Naik2009-12-271-19/+13
|
* Add new finder methods to association collection.Pratik Naik2009-12-271-2/+17
|
* Callbacks, DeprecatedCallbacks = NewCallbacks, CallbacksJoshua Peek2009-10-121-1/+1
|
* Added back support for destroying an association's object by id. [#2306 ↵Joshua Nichols2009-08-091-0/+1
| | | | | | status:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Merge docrailsPratik Naik2009-07-251-2/+2
|
* Revert "Revert "Generate proper :counter_sql from :finder_sql when there is ↵Pratik Naik2009-07-011-1/+13
| | | | | | | | | 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-13/+1
| | | | | | | | 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-1/+13
| | | | | | character immediately following 'SELECT' [#2118 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Implement #many? for NamedScope and AssociationCollection using #size [#1500 ↵Chris Kampmeier2009-05-171-0/+9
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Providing support for :inverse_of as an option to associations.Murray Steele2009-05-041-2/+6
| | | | | | | | | | | | | | | | | | | | | | 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>
* Merge docrailsPratik Naik2009-03-161-5/+9
|
* Ensure AutosaveAssociation runs remove callbacks [#2146 state:resolved]Luca Guidi2009-03-121-19/+32
| | | | | Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com> Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Add tests for AssociationCollection#find_each and ↵Pratik Naik2009-03-111-1/+1
| | | | AssociationCollection#find_in_batches
* Fix preloading of has_one :through associations on belongs_to [#1507 ↵Matt Jones2008-12-181-1/+5
| | | | | | state:resolved] Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>