| 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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
'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
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| | |
newline character immediately following 'SELECT' [#2118 state:resolved]"
This reverts commit 4851ca9e13a4317342df02ae25b1929340523f7a.
The tests do not pass for postgresql.
|
| |
| |
| |
| |
| |
| | |
character immediately following 'SELECT' [#2118 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
|
|\| |
|
| |
| |
| |
| |
| |
| | |
[#1642 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|/ |
|
|
|
|
|
|
| |
state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|