aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
Commit message (Collapse)AuthorAgeFilesLines
...
* | Remove blank trailing commentsHenrik Hodne2012-05-201-1/+0
| | | | | | | | | | | | | | For future reference, this is the regex I used: ^\s*#\s*\n(?!\s*#). Replace with the first match, and voilà! Note that the regex matches a little bit too much, so you probably want to `git add -i .` and go through every single diff to check if it actually should be changed.
* | add CollectionProxy#select documentationFrancesco Rodriguez2012-05-191-2/+55
| |
* | add CollectionProxy#find documentationFrancesco Rodriguez2012-05-191-0/+20
|/
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-05-192-11/+293
|\
| * copy edits [ci skip]Vijay Dev2012-05-191-17/+20
| |
| * add CollectionProxy#last documentationFrancesco Rodriguez2012-05-191-0/+27
| |
| * add CollectionProxy#first documentationFrancesco Rodriguez2012-05-191-0/+27
| |
| * improve CollectionProxy#concat documentationFrancesco Rodriguez2012-05-191-7/+18
| |
| * fix CollectionProxy#<< documentationFrancesco Rodriguez2012-05-191-1/+1
| |
| * add CollectionProxy#<< documentationFrancesco Rodriguez2012-05-191-0/+20
| |
| * add CollectionProxy#clear documentationFrancesco Rodriguez2012-05-191-0/+26
| |
| * add CollectionProxy#include? documentationFrancesco Rodriguez2012-05-181-0/+13
| |
| * move docs from CollectionAssociation to CollectionProxyFrancesco Rodriguez2012-05-182-114/+143
| |
| * remove incorrect example of CollectionAssociation#empty?Francesco Rodriguez2012-05-181-17/+0
| |
| * add docs to CollectionAssociation#empty?Francesco Rodriguez2012-05-181-3/+32
| |
| * add docs to CollectionAssociation#any?Francesco Rodriguez2012-05-181-0/+30
| |
| * add examples to CollectionAssociation#concatFrancesco Rodriguez2012-05-181-3/+14
| |
| * fix CollectionAssociation docsFrancesco Rodriguez2012-05-171-1/+1
| |
| * add example to CollectionAssociation#destroy_allFrancesco Rodriguez2012-05-171-3/+14
| |
| * add more explanation to CollectionAssociation docsFrancesco Rodriguez2012-05-171-0/+4
| |
| * add CollectionAssociation hierarchyFrancesco Rodriguez2012-05-171-2/+7
| |
| * add docs to CollectionAssociation#many?Francesco Rodriguez2012-05-171-1/+34
| |
| * fix CollectionAssociation#replace docsFrancesco Rodriguez2012-05-171-3/+3
| |
| * Add docs to CollectionAssociation#replaceFrancesco Rodriguez2012-05-171-3/+23
| |
* | Merge pull request #4835 from ↵Carlos Antonio da Silva2012-05-191-3/+3
|\ \ | | | | | | | | | | | | pacoguzman/refactor_define_restrict_dependency_method Refactor define_restrict_dependency_method using reflection
| * | Refactor define_restrict_dependency_method using reflectionPaco Guzman2012-02-011-3/+3
| | |
* | | Ensure that CollectionAssociation#replace returns proper targetPiotr Sarnacki2012-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The fix commited in e2a070c was returning the `new_target`, as a try to return whatever user replaced association with. The problem is, the resulting association target may be ordered differently. In such case we want to return the target that will be later used for that association.
* | | fix #delete_all with habtm with :delete_sqlJon Leighton2012-05-181-0/+1
| | |
* | | no longer need #delete_all_on_destroyJon Leighton2012-05-185-17/+2
| | |
* | | Perf: Don't load the association for #delete_all.Jon Leighton2012-05-184-10/+35
| |/ |/| | | | | Bug #6289
* | Merge pull request #5453 from ↵Aaron Patterson2012-05-161-2/+6
|\ \ | | | | | | | | | | | | JonRowe/patch_uniq_has_and_belongs_to_many_when_already_loaded When Active Record has already loaded a unique association `.size` returns the wrong number.
| * | when using a preloaded array and the uniq flag is set then return the size ↵Jon Rowe2012-03-151-2/+6
| | | | | | | | | | | | of the uniq array
* | | Fix CollectionAssociation#replace to return new target (closes #6231)Piotr Sarnacki2012-05-161-0/+2
| | |
* | | Remove #=== quirkJon Leighton2012-05-111-6/+0
| | | | | | | | | | | | Makes it consistent with Relation. Can't see a use for this.
* | | this stuff can all be handled by RelationJon Leighton2012-05-111-38/+0
| | |
* | | extract deprecated codeJon Leighton2012-05-111-8/+1
| | |
* | | set_owner_attributes is covered by the scopingJon Leighton2012-05-111-4/+3
| | |
* | | CollectionProxy < RelationJon Leighton2012-05-112-22/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps bring the interfaces of CollectionProxy and Relation closer together, and reduces the delegation backflips we need to perform. For example, first_or_create is defined thus: class ActiveRecord::Relation def first_or_create(...) first || create(...) end end If CollectionProxy < Relation, then post.comments.first_or_create will hit the association's #create method which will actually add the new record to the association, just as post.comments.create would. With the previous delegation, post.comments.first_or_create expands to post.comments.scoped.first_or_create, where post.comments.scoped has no knowledge of the association.
* | | Revert "Merge pull request #5494 from ↵Jon Leighton2012-05-052-7/+2
| | | | | | | | | | | | | | | | | | | | | armstrjare/active_record_relation_keep_association_join_context_on_merge" This reverts commit dcd04e76179611a9db28c9e391aa7d6c2a5b046a, reversing changes made to 58a49875df63729f07a9a81d1ee349087d258df5.
* | | Merge pull request #5494 from ↵Jon Leighton2012-05-052-2/+7
|\ \ \ | | | | | | | | | | | | | | | | armstrjare/active_record_relation_keep_association_join_context_on_merge ActiveRecord::Relation - maintain context of joined associations on merges
| * | | Allow ActiveRecord::Relation merges to maintain context of joined associationsJared Armstrong2012-05-042-2/+7
| | | |
* | | | extract code from AR::BaseJon Leighton2012-05-041-1/+1
| | | |
* | | | clean up implementation of dynamic methods. use method compilation etc.Jon Leighton2012-05-041-3/+3
|/ / /
* | | Fix issue with private kernel methods and collection associations. Closes #2508Carlos Antonio da Silva2012-05-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Change CollectionProxy#method_missing to use scoped.public_send, to avoid a problem described in issue #2508 when trying to use class methods with names like "open", that clash with private kernel methods. Also changed the dynamic matcher instantiator to send straight to scoped, to avoid another roundtrip to method_missing.
* | | allow AssociationProxy#scoped to take options so that API is the same as ↵Jon Leighton2012-04-271-2/+6
| | | | | | | | | | | | Base#scoped
* | | Merge remote-tracking branch 'jmbejar/define_array_methods_collection_proxy'Jon Leighton2012-04-251-0/+13
|\ \ \
| * | | Define array methods in ActiveRecord::Associations::CollectionProxyJorge Bejar2012-04-181-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | if they are not defined or delegated. In this way, we have a performance boost invoking some array methods which are not defined in CollectionAssociation.
* | | | Merge remote-tracking branch 'kennyj/fix_5563'Jon Leighton2012-04-254-4/+6
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/test/cases/associations/belongs_to_associations_test.rb
| * | | | Fix #5563. Should reflect the most recent change to either of association / id.kennyj2012-04-131-1/+2
| | | | |
| * | | | @stale_state should be nil when a model isn't saved.kennyj2012-04-133-3/+4
| | | | |