| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Based on examples seen in the Rails test suite. [ci skip]
|
|
|
|
| |
now we can invoke previously added scope extension methods
|
|
|
|
| |
Record.from("(#{sub_query.to_sql})") -> Record.from(sub_query)
Record.from("(#{sub_query.to_sql}) a") -> Record.from(sub_query, :a)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This helps bring the interfaces of CollectionProxy and Relation closer
together, and reduces the delegation backflips we need to perform.
For example, first_or_create is defined thus:
class ActiveRecord::Relation
def first_or_create(...)
first || create(...)
end
end
If CollectionProxy < Relation, then post.comments.first_or_create will
hit the association's #create method which will actually add the new record
to the association, just as post.comments.create would.
With the previous delegation, post.comments.first_or_create expands to
post.comments.scoped.first_or_create, where post.comments.scoped has no
knowledge of the association.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The main reason for this is that I want to separate the code that does
the mutating from the code that does the cloning.
|
|
|
|
|
|
| |
add test to show offset query_methods on mysql & mysql2
change test to cover public API
|
|\
| |
| |
| |
| | |
Conflicts:
activerecord/lib/active_record/relation/query_methods.rb
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
| |
And added NullRelation class implementing the null object pattern for the `Relation` class.
|
|
|
|
|
| |
Also, fixed the bit about returning AM::MissingAttributeError. This
seems to be fixed earlier in 3-2-stable only.
|
| |
|
| |
|
| |
|
| |
|
|\ |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This reverts commit 0df27c98d982ec87d2fb48cfda82694eb267993e.
Reverted due to failing test, see #2845.
|
|
|
| |
Replace split on comma with a regexp that will reverse all ASC/DESC specifically
|
|
|
|
| |
therefore counted by the alias tracker. This is because the association_joins are aliased on initialization and then the tables are cached, so it is no use to alias the join_nodes later. Fixes #2556.
|
|
|
|
|
|
|
| |
This reverts commit 9d396ee8195e31f646e0b89158ed96f4db4ab38f, reversing
changes made to fa2bfd832c1d1e997d93c2269a485cc74782c86d.
Reason: the change broke the build.
|
| |
|
|
|
|
|
|
|
| |
This reverts commit 04cc446d178653d362510e79a22db5300d463161.
I reverted it because apparently we want to use: select([:a, :b])
instead of select(:a, :b), but there was no tests for that form.
|
| |
|
| |
|
|
|
|
|
|
| |
respond to empty?
having raises NoMethodError: undefined method `empty?' when a Fixnum or Date/Time were passed via varargs
|
| |
|
| |
|
| |
|
|
|
|
| |
test surrounding create_with(nil) behavior
|
| |
|
|
|
|
|
| |
Set reverse_order_value when asked to reverse_order().
Do the actual reversal in build_arel.
|
|
|
|
| |
problems with default scopes getting included into other scopes and then being unable to remove the default part via unscoped.
|
|
|
|
| |
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
ActiveRecord::Associations::ClassMethods to just ActiveRecord::Associations
|
| | |
|