| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|/
|
|
|
|
| |
If assigning to a has_many :through collection against an unsaved
object using the collection=[<array_of_items>] syntax, the join models
were not properly created, previously.
|
| |
|
| |
|
|
|
|
|
|
| |
It has been moved to active_record_deprecated_finders.
Use #to_a instead.
|
| |
|
|
|
|
| |
Bug #6289
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
If a record is removed from a has_many :through, all of the join records
relating to that record should also be removed from the through
association's target.
(Previously the records were removed in the database, but only one was
removed from the in-memory target array.)
|
|
|
|
| |
Fixes #3425.
|
|
|
|
| |
issue where the collection proxies were not consistent
|
|
|
|
| |
Fixes #1360.
|
|
|
|
| |
security options (:as and :without_protection) in build, create and create! methods.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
|
| |
| |
| |
| | |
accessing the instance variables
|
| |
| |
| |
| | |
manages the association, and a CollectionProxy class which is *only* a proxy. Singular associations no longer have a proxy. See CHANGELOG for more.
|
| |
| |
| |
| | |
the join record is automatically saved too. This requires the :inverse_of option to be set on the source association in the join model. See the CHANGELOG for details. [#4329 state:resolved]
|
| | |
|
| | |
|
| |
| |
| |
| | |
be more consistent with each other, and to stop passing blocks around, thus making the execution easier to follow.
|
| |
| |
| |
| | |
state:resolved]. Also fixed a bunch of other counter cache bugs in the process, as once I fixed this one others started appearing like nobody's business.
|
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
records in the join table. This is to make the destroy method more consistent across the different types of associations. For more details see the CHANGELOG entry.
|
| | |
|
| |
| |
| |
| | |
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 key which it relates to is :foreign_key
|
| | |
|
| |
| |
| |
| | |
other things
|
| | |
|
| |
| |
| |
| | |
postfix ifs (it's easier to read)
|
| |
| |
| |
| | |
HasManyThroughAssociation, as the exact same methods are inherited from HasManyAssociation
|
| |
| |
| |
| | |
that those operations are automatically scoped and therefore construct_join_attributes does not need to use construct_owner_attributes.
|
| |
| |
| |
| | |
belongs_to changes, then the has_many should be considered stale.
|
| |
| |
| |
| | |
exchange for more generic versions in AssociationCollection
|
| |
| |
| |
| | |
indicate that subclasses should implement it. Also add save_record to reduce duplication.
|
| | |
|
| | |
|
|\|
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
activerecord/CHANGELOG
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_through_association.rb
|
| | |
|
|\|
| |
| |
| |
| |
| | |
Conflicts:
activerecord/lib/active_record/associations/has_many_through_association.rb
activerecord/test/cases/associations/has_many_through_associations_test.rb
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
has_many association (occurs only before main object has been reloaded).
[#5968 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- persisted? is the API defined in ActiveModel
- makes it easier for extension libraries to conform to ActiveModel APIs
without concern for whether the extended object is specifically
ActiveRecord
[#5927 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| |
| |
| |
| | |
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.
|