Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Delegate through_reflection and source_reflection to reflection | Jon Leighton | 2011-02-21 | 1 | -23/+23 |
| | |||||
* | Delegate Association#options to the reflection, and replace ↵ | Jon Leighton | 2011-02-21 | 1 | -9/+11 |
| | | | | 'reflection.options' with 'options'. Also add through_options and source_options methods for through associations. | ||||
* | Associations - where possible, call attributes methods rather than directly ↵ | Jon Leighton | 2011-02-21 | 1 | -34/+34 |
| | | | | accessing the instance variables | ||||
* | Add :nodoc: to ThroughAssociation and HasOneAssociation | Jon Leighton | 2011-02-18 | 1 | -1/+1 |
| | |||||
* | Add interpolation of association conditions back in, in the form of proc { ↵ | Jon Leighton | 2011-02-14 | 1 | -2/+2 |
| | | | | ... } rather than instance_eval-ing strings | ||||
* | Remove Relation#& alias for Relation#merge | Ernie Miller | 2011-02-12 | 1 | -1/+1 |
| | |||||
* | Support the :dependent option on has_many :through associations. For ↵ | Jon Leighton | 2011-02-07 | 1 | -7/+26 |
| | | | | 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. | ||||
* | Make use of helpers in AssociationReflection | Jon Leighton | 2011-01-30 | 1 | -4/+4 |
| | |||||
* | Has many through - It is not necessary to manually merge in the conditions ↵ | Jon Leighton | 2011-01-30 | 1 | -4/+0 |
| | | | | hash for the through record, because the creation is done directly on the through association, which will already handle setting the conditions. | ||||
* | Don't pass around conditions as strings in ThroughAssociation | Jon Leighton | 2011-01-30 | 1 | -30/+25 |
| | |||||
* | Indent methods under private/protected sections | Jon Leighton | 2011-01-30 | 1 | -101/+101 |
| | |||||
* | Let's be less blasé about method visibility on association proxies | Jon Leighton | 2011-01-30 | 1 | -7/+9 |
| | |||||
* | Construct an actual ActiveRecord::Relation object for the association scope, ↵ | Jon Leighton | 2011-01-07 | 1 | -13/+8 |
| | | | | 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. | ||||
* | Create the association scope directly rather than going through with_scope | Jon Leighton | 2011-01-03 | 1 | -9/+6 |
| | |||||
* | Let AssociationCollection#find use #scoped to do its finding. Note that I am ↵ | Jon Leighton | 2011-01-03 | 1 | -14/+5 |
| | | | | 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. | ||||
* | Rename AssociationProxy#foreign_key_present to foreign_key_present? | Jon Leighton | 2011-01-03 | 1 | -1/+1 |
| | |||||
* | Allow assignment on has_one :through where the owner is a new record [#5137 ↵ | Jon Leighton | 2011-01-03 | 1 | -13/+7 |
| | | | | | | | | | | 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! | ||||
* | Have a proper AssociationReflection#foreign_type method rather than using ↵ | Jon Leighton | 2011-01-03 | 1 | -2/+2 |
| | | | | options[:foreign_type] | ||||
* | Rename AssociationReflection#primary_key_name to foreign_key, since the ↵ | Jon Leighton | 2010-12-31 | 1 | -5/+5 |
| | | | | options key which it relates to is :foreign_key | ||||
* | Refactor BelongsToAssociation to allow BelongsToPolymorphicAssociation to ↵ | Jon Leighton | 2010-12-31 | 1 | -2/+0 |
| | | | | inherit from it | ||||
* | Add a HasAssociation module for common code for has_* associations | Jon Leighton | 2010-12-26 | 1 | -0/+169 |