| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | | |
find and exists?
|
| | |
| | |
| | |
| | | |
Closes #14640
|
| | | |
|
| | |
| | |
| | |
| | | |
provided.
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Remove extracting `polymorphic_base_class` for `Array` in `AssociationQueryValue`
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`AssociationQueryValue`
It is handled by `PolymorphicArrayValue`.
|
| |/ /
|/| |
| | |
| | |
| | |
| | | |
Some methods were added to public API in
5b14129d8d4ad302b4e11df6bd5c7891b75f393c and they should be not part of
the public API.
|
| | | |
|
| | | |
|
| | | |
|
| |/
|/|
| |
| | |
Raise `ActiveRecord::RangeError` when values that executed are out of range.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
9c9fb19 changed the behaviour of the _ids= setters for associations to
raise an AssociationTypeMismatch when unknown IDs are given:
Class: <ActiveRecord::AssociationTypeMismatch>
Message: <"Developer(#43811860) expected, got NilClass(#16732720)">
This restores the original ActiveRecord::RecordNotFound exception with a
much clearer error message:
Class: <ActiveRecord::RecordNotFound>
Message: <"Couldn't find all Developers with 'id': (1, -9999) [WHERE \"contracts\".\"company_id\" = ?] (found 1 results, but was looking for 2)">
Fixes #25719
|
|\ \
| | |
| | | |
Should except `:distinct` rather than `:order` for `exists?`
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Records fetching order is very important for performance if `limit` is
presented. Should not except the order in the case.
And `exists?` replaces select list to `1 AS one` therefore `:distinct`
is useless (`DISTINCT 1 AS one`). And PostgreSQL raises the following
error if `:distinct` and `:order` are used in the same time.
```
ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
```
|
|/ /
| |
| |
| | |
All query methods calls `spawn` and bang method, but only `none` is not.
|
| |
| |
| |
| |
| | |
If `limit_value` is presented, records fetching order is very important
for performance. Should not unscope the order in the case.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Regexp#match? should be considered to be part of the Ruby core library. We are
emulating it for < 2.4, but not having to require the extension is part of the
illusion of the emulation.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- CollectionAssociation#select was removed in
https://github.com/rails/rails/pull/25989 in favor of
QueryMethods#select but it caused a regression when passing arguments
to select and a block.
- This used to work earlier in Rails 4.2 and Rails 5. See gist
https://gist.github.com/prathamesh-sonpatki/a7df922273473a77dfbc742a4be4b618.
- This commit restores the behavior of Rails 4.2 and Rails 5.0.0 to
allow passing arguments and block at the same time but also deprecates
it.
- Because, these arguments do not have any effect on the output of
select when select is used with a block.
- Updated documentation to remove the example passing arguments and
block at the same time to `CollectionProxy#select`.
|
|\ \
| | |
| | |
| | |
| | | |
rutaka-n/raise_record_not_found_with_correct_params
initialize errors with name of class and other params
|
| |/ |
|
| | |
|
|/ |
|
|\
| |
| | |
Reduce array allocation when `where` with passed hash
|
| |
| |
| |
| |
| | |
In most case `where` is called with passed hash. In the case
initializing `binds` is unnecessary.
|
|\ \
| | |
| | | |
Rename variable name that returning `type_for` to `type` from `column`
|
| |/
| |
| |
| |
| |
| | |
`column_for` was changed to `type_for` to return `type` object at
36bd52b4. But variable name is still `column`. It is very confusing.
Rename variable name `column` to `type` for readability.
|
|/
|
|
|
|
| |
All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772.
But comments was still kept absolute position. This commit aligns
comments with method definitions for consistency.
|
|
|
|
|
|
|
|
|
| |
Recently, the Rails team made an effort to keep the source code consistent, using Ruboco
(bb1ecdcc677bf6e68e0252505509c089619b5b90 and below). Some of the case
statements were missed.
This changes the case statements' formatting and is consistent with changes
in 810dff7c9fa9b2a38eb1560ce0378d760529ee6b and db63406cb007ab3756d2a96d2e0b5d4e777f8231.
|
|
|
|
|
| |
Bang methods of `AR::QueryMethods` are used only internally.
We only use `left_outer_joins!`, so we can remove this alias.
|
|
|
|
|
|
| |
All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772.
But heredocs was still kept absolute position. This commit aligns
heredocs indentation for consistency.
|
|
|
|
|
|
|
|
|
| |
This reverts commit 3a1f6fe7b4a70bf0698b0684dd48ac712c6883b6.
This commit takes the code in a direction that I am looking to avoid.
The predicate builder should be purely concerned with AST construction
as it matters to methods like `where`. Things like case sensitivity
should continue to be handled elsewhere.
|
|
|
|
|
|
|
|
|
|
| |
This was almost every case where we are overriding `respond_to?` in a
way that mirrors a parallel implementation of `method_missing`. There is
one remaining case in Active Model that should probably do the same
thing, but had a sufficiently strange implementation that I want to
investigate it separately.
Fixes #26333.
|
|
|
|
| |
For reduce instantiating `Type::Value`.
|
|\
| |
| | |
Remove over meta programming in AR::Relation
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Introduced low level methods #set_value and #get_value for setting query attributes:
relation.set_value(:where, {id: 1})
relation.get_value(:includes)
Used those internally when working with relation's attributes
at the abstract level
|
| |
| |
| |
| |
| | |
Currently `CollectionProxy` inherits `Relation` therefore we can use
its own methods rather than delegating to collection association.
|
|\ \
| | |
| | | |
`pluck` should use `records` (`load_target`) when `loaded?` is true
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | | |
Fix does_not_support_reverse? to find sql functions with commas in nested brackets
|
| | | | |
|
| |/ /
| | |
| | |
| | | |
brackets
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
kamipo/finder_bang_method_should_call_non_bang_method
Finder bang method should call non bang method
|
| | |/
| |/|
| | |
| | | |
Otherwise CollectionProxy's bang methdos cannot respect dirty target.
|
|\ \ \
| | | |
| | | |
| | | | |
Extract `PredicateBuilder::CaseSensitiveHandler`
|