- 03 11月, 2011 2 次提交
-
-
由 Jon Leighton 提交于
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.)
-
由 Jon Leighton 提交于
Fixes #3425.
-
- 01 6月, 2011 2 次提交
-
-
由 Josh Kalderimis 提交于
added an alias for new to build to the AR collection proxy, this corrects an issue where the collection proxies were not consistent
-
由 Jon Leighton 提交于
-
- 02 5月, 2011 1 次提交
-
-
由 Josh Kalderimis 提交于
singular and collection relations in AR can now specify mass-assignment security options (:as and :without_protection) in build, create and create! methods.
-
- 22 2月, 2011 2 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
Associations - where possible, call attributes methods rather than directly accessing the instance variables
-
- 18 2月, 2011 2 次提交
-
-
由 Jon Leighton 提交于
Split AssociationProxy into an Association class (and subclasses) which manages the association, and a CollectionProxy class which is *only* a proxy. Singular associations no longer have a proxy. See CHANGELOG for more.
-
由 Jon Leighton 提交于
Allow building and then later saving has_many :through records, such that 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]
-
- 14 2月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 08 2月, 2011 5 次提交
-
-
由 Aaron Patterson 提交于
-
由 Jon Leighton 提交于
Refactor the implementations of AssociatioCollection#delete and #destroy to be more consistent with each other, and to stop passing blocks around, thus making the execution easier to follow.
-
由 Jon Leighton 提交于
Correctly update counter caches on deletion for has_many :through [#2824 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.
-
由 Jon Leighton 提交于
Support the :dependent option on has_many :through associations. For 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.
-
由 Jon Leighton 提交于
Make record.association.destroy(*records) on habtm and hm:t only delete 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.
-
- 30 1月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 04 1月, 2011 2 次提交
-
-
由 Jon Leighton 提交于
Let AssociationCollection#find use #scoped to do its finding. Note that I am 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.
-
由 Jon Leighton 提交于
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!
-
- 01 1月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
Rename AssociationReflection#primary_key_name to foreign_key, since the options key which it relates to is :foreign_key
-
- 28 12月, 2010 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 27 12月, 2010 5 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
Use conditionals and implicit returns rather than explicit returns and postfix ifs (it's easier to read)
-
由 Jon Leighton 提交于
Remove has_cached_counter? and cached_counter_attribute_name from HasManyThroughAssociation, as the exact same methods are inherited from HasManyAssociation
-
由 Jon Leighton 提交于
Use the through association proxy for operations on the through record, so that those operations are automatically scoped and therefore construct_join_attributes does not need to use construct_owner_attributes.
-
- 24 12月, 2010 1 次提交
-
-
由 Jon Leighton 提交于
If a has_many goes :through a belongs_to, and the foreign key of the belongs_to changes, then the has_many should be considered stale.
-
- 21 12月, 2010 2 次提交
-
-
由 Jon Leighton 提交于
Delete create, create! and create_record from HasManyThroughAssociation in exchange for more generic versions in AssociationCollection
-
由 Jon Leighton 提交于
Specify insert_record with NotImplementedError in AssociationCollection, to indicate that subclasses should implement it. Also add save_record to reduce duplication.
-
- 16 12月, 2010 3 次提交
-
-
由 Jon Leighton 提交于
-
由 Aaron Patterson 提交于
-
由 Jon Leighton 提交于
-
- 15 12月, 2010 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 28 11月, 2010 1 次提交
-
-
由 José Valim 提交于
-
- 15 11月, 2010 2 次提交
-
-
由 Santiago Pastorino 提交于
-
由 Jason Cheow 提交于
Fix bug where size of through association is not correct after adding a has_many association (occurs only before main object has been reloaded). [#5968 state:committed] Signed-off-by: NSantiago Pastorino <santiago@wyeworks.com>
-
- 09 11月, 2010 1 次提交
-
-
由 David Chelimsky 提交于
- 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: NSantiago Pastorino <santiago@wyeworks.com>
-
- 31 10月, 2010 1 次提交
-
-
由 Jon Leighton 提交于
-
- 30 10月, 2010 1 次提交
-
-
由 Jon Leighton 提交于
Refactoring: replace the mix of variables like @finder_sql, @counter_sql, 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.
-
- 20 10月, 2010 1 次提交
-
-
由 Jon Leighton 提交于
-
- 18 10月, 2010 1 次提交
-
-
由 Jon Leighton 提交于
Refactoring: replace the mix of variables like @finder_sql, @counter_sql, 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.
-