| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
| |
The build_association method was added as an API for plugins
to hook into in 1398db0. This commit restores this API and the
ability to override class.new to return a subclass based on
a virtual attribute in the attributes hash.
|
|\
| |
| | |
Fixing has_many when ActiveRecord::Base.pluralize_table_names is false
|
| |
| |
| |
| | |
false. fixes #557
|
|/
|
|
| |
attributes when copying, rather than using the assignment method
|
|
|
|
| |
association conditions on singular associations. Fixes #481 (again).
|
|
|
|
| |
Fixes #508.
|
|
|
|
| |
be assigned without mass-assignment protection when a record is built on the association.
|
|
|
|
| |
delete method.
|
|\
| |
| | |
Assign protected attributes with create/new and control the role.
|
| |
| |
| |
| | |
security options (:as and :without_protection) in build, create and create! methods.
|
|/
|
|
| |
reflect its use cases
|
|
|
|
| |
security scope using the :as option, while also allowing mass-assignment security to be bypassed using :with_protected
|
|
|
|
| |
You can also just use a block.
|
|
|
|
| |
macro multiple times that will give deprecation warnings, and in 3.2 we will simply overwrite the default scope when you call the macro multiple times.
|
|
|
|
|
|
|
|
|
|
| |
the scope class method. Just define a class method yourself instead."
This reverts commit f0e198bfa1e3f9689e0cde1d194a44027fc90b3c.
Conflicts:
activerecord/test/models/post.rb
|
| |
|
|
|
|
| |
class method. Just define a class method yourself instead.
|
|
|
|
| |
problems with default scopes getting included into other scopes and then being unable to remove the default part via unscoped.
|
|
|
|
| |
favour of defining a 'default_scope' class method in the model. See the CHANGELOG for more details.
|
| |
|
|
|
|
| |
the code which support this
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
|
| |
| |
| |
| | |
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]
|
| |
| |
| |
| | |
is a has_many :through with a :primary_key option on the source reflection. [#6376 state:resolved]
|
| |
| |
| |
| | |
... } rather than instance_eval-ing strings
|
| | |
|
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
| | |
|
| |
| |
| |
| | |
subclass once
|
| |
| |
| |
| | |
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
| |
| |
| |
| | |
hash for the through record, because the creation is done directly on the through association, which will already handle setting the conditions.
|
| |
| |
| |
| | |
this can affect validations/callbacks/etc inside the record itself [#6252 state:resolved]
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
the new record, so we don't get the database into a pickle
|
| | |
|
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| | |
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!
|
| |
| |
| |
| | |
previously completely untested.
|
| |
| |
| |
| | |
:destroy, when the parent is destroyed, the callbacks are run
|
| | |
|