| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
| |
Fixes creating records in a through association with a polymorphic source
type.
|
|
|
|
| |
association scope.
|
|
|
|
| |
model should not be included in the association scope. (We're already excluding includes.) Fixes #2834.
|
| |
|
|
|
|
| |
Fixes #508.
|
|
|
|
| |
scoped.scope_for_create. Fixes #481.
|
| |
|
|
|
|
| |
Reflection#chain and Reflection#options as they now no longer relate solely to through associations.
|
|
|
|
| |
AssociationScope class which is capable of building a scope for any association.
|
|
|
|
| |
test_has_many_association_through_a_has_many_association_with_nonstandard_primary_keys
|
|
|
|
| |
construct_owner_conditions.
|
|
|
|
| |
order that they should be joined together.
|
|
|
|
| |
JoinDependency::JoinAssociation and into the reflection instead.
|
|
|
|
| |
the code which support this
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Conflicts:
activerecord/CHANGELOG
activerecord/lib/active_record/association_preload.rb
activerecord/lib/active_record/associations.rb
activerecord/lib/active_record/associations/class_methods/join_dependency.rb
activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb
activerecord/lib/active_record/associations/has_many_association.rb
activerecord/lib/active_record/associations/has_many_through_association.rb
activerecord/lib/active_record/associations/has_one_association.rb
activerecord/lib/active_record/associations/has_one_through_association.rb
activerecord/lib/active_record/associations/through_association_scope.rb
activerecord/lib/active_record/reflection.rb
activerecord/test/cases/associations/has_many_through_associations_test.rb
activerecord/test/cases/associations/has_one_through_associations_test.rb
activerecord/test/cases/reflection_test.rb
activerecord/test/cases/relations_test.rb
activerecord/test/fixtures/memberships.yml
activerecord/test/models/categorization.rb
activerecord/test/models/category.rb
activerecord/test/models/member.rb
activerecord/test/models/reference.rb
activerecord/test/models/tagging.rb
|
| |
|
|
|
|
| |
'reflection.options' with 'options'. Also add through_options and source_options methods for through associations.
|
|
|
|
| |
accessing the instance variables
|
| |
|
|
|
|
| |
... } rather than instance_eval-ing strings
|
| |
|
|
|
|
| |
historical and practical reasons, :delete_all is the default deletion strategy employed by association.delete(*records), despite the fact that the default strategy is :nullify for regular has_many. Also, this only works at all if the source reflection is a belongs_to. For other situations, you should directly modify the through association.
|
| |
|
|
|
|
| |
hash for the through record, because the creation is done directly on the through association, which will already handle setting the conditions.
|
| |
|
| |
|
| |
|
|
|
|
| |
rather than a hash which is passed to apply_finder_options. This allows more flexibility in how the scope is created, for example because scope.where(a, b) and scope.where(a).where(b) mean different things.
|
| |
|
|
|
|
| |
removing test_polymorphic_has_many_going_through_join_model_with_disabled_include, since this specifies different behaviour for an association than for a regular scope. It seems reasonable to expect scopes and association proxies to behave in roughly the same way rather than having subtle differences.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
state:resolved]
This required changing the code to keep the association proxy for a belongs_to around, despite its target being nil. Which in turn required various changes to the way that stale target checking is handled, in order to support various edge cases (loaded target is nil then foreign key added, foreign key is changed and then changed back, etc). A side effect is that the code is nicer and more succinct.
Note that I am removing test_no_unexpected_aliasing since that is basically checking that the proxy for a belongs_to *does* change, which is the exact opposite of the intention of this commit. Also adding various tests for various edge cases and related things.
Phew, long commit message!
|
|
|
|
| |
options[:foreign_type]
|
|
|
|
| |
options key which it relates to is :foreign_key
|
|
|
|
| |
inherit from it
|
|
|