| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| | |
generating a 'chain' of reflections to be joined. It seems to work at the moment, all existing tests are passing. There may be further complications as we add more test cases for nested associations, though.
|
| |
| |
| |
| | |
structure of ThroughAssociationScope rather than layering a module over the top
|
|/ |
|
|
|
|
| |
's/[ \t]*$//' -i {} \;)
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\ |
|
| | |
|
| | |
|
| | |
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
activerecord/lib/active_record/calculations.rb
activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
|
| |
| |
| |
| |
| |
| | |
[#2934 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
| |
| |
| |
| | |
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
|
|\|
| |
| |
| |
| | |
Conflicts:
activerecord/lib/active_record/migration.rb
|
| |
| |
| |
| | |
owner is new
|
|\| |
|