| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
rails/kamipo/ordinal_methods_should_respect_loaded_records"
This reverts commit 0f79ab91150b4cdb6c018530978a3395962c7a02, reversing
changes made to d575f7f2e737739302a0e8210d01c10f5d4e2c35.
This PR philosophically conflicts with #30800 and Matthew thinks we
should hold off merging this until we find concensus. Reverting since
we're about to cut a release for 5.2.
|
|\
| |
| | |
Provide arguments to RecordNotFound
|
| | |
|
|\ \
| |/
|/|
| |
| | |
rails/kamipo/ordinal_methods_should_respect_loaded_records
Ordinal methods should respect loaded records
|
| |
| |
| |
| |
| |
| | |
We should reset partially loaded `@offsets` cache when latest records
has loaded because the cache has been staled and it may not be
consistent with latest records.
|
| | |
|
| | |
|
|/ |
|
|
|
|
| |
test cases
|
|
|
|
|
| |
`relation.exists?` should reference correct aliases while joining tables
of has_many through associations.
|
|\
| |
| | |
Return Not found Ids in ActiveRecord::NotFound
|
| |
| |
| |
| |
| | |
This builds on top of 15e2da656f41af0124f7577858536f3b65462ad5.
now it also returns exact Ids which were not found which will be debugging simple.
|
|\ \
| |/
|/| |
Fix `find_by` with range conditions
|
| |
| |
| |
| |
| | |
`StatementCache` doesn't support range conditions. So we need to through
the args to `FinderMethods#find_by` if range value is passed.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
| |
The `find_each`, `find_in_batches` and `in_batches` APIs usually operate
on large numbers of records, where it's preferable not to load them all
into memory at once.
If the query cache is enabled, it will hold onto the query results until
the end of the execution context (request/job), which means the memory
used is still proportional to the total number of records. These queries
are typically not repeated, so the query cache isn't desirable here.
|
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
If the `index` exceeds a `limit`, simply return an empty result without
querying the database.
|
|
|
|
|
|
|
| |
```
go get -u github.com/client9/misspell/cmd/misspell
misspell -w -error -source=text .
```
|
|
|
|
|
|
|
|
|
|
| |
The alternative of #26213.
Currently `find_by` and `where` with AR object return inconsistent
result. This is caused by statement cache does not support AR object.
Passing to finder method to fix the issue.
Fixes #26210.
|
|
|
|
| |
Follow up to 4b6709e818177792735e99a70ec03210c0ac38dc.
|
|
|
|
| |
find and exists?
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message
assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
|
|\
| |
| |
| |
| | |
kamipo/dont_handle_as_associated_predicate_if_table_has_column
Do not handle as an associated predicate if a table has the column
|
| |
| |
| |
| |
| |
| | |
If handled as an associated predicate even though a table has the
column, will generate invalid SQL by valid column name treated as a
table name.
|
|\ \
| |/
|/| |
Remove internal `sanitize` method
|
| |
| |
| |
| |
| | |
Currently internal `sanitize`/`quote_value` method is only used for `quoted_id`.
Simply it is enough to use `connection.quote` public API instead.
|
|\ \
| | |
| | | |
When calling association.find RecordNotFound is now raised with the s…
|
| | |
| | |
| | |
| | | |
argument as when we do it in Record.find (primary_key, id and model).
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
|
| |
| |
| |
| |
| | |
also test `ROWNUM <=` for Oracle 11g or older version of Oracle and Oracle visitor
Oracle 12c database and Arel Oracle12 visitor supports better top N query.
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`FinderMethods#exists?` should return a boolean rather than raising an
exception.
`UniquenessValidator#build_relation` catches a `RangeError` because it
includes type casting due to a string value truncation. But a string
value truncation was removed at #23523 then type casting in
`build_relation` is no longer necessary. aa06231 removes type casting in
`build_relation` then a `RangeError` moves to `relation.exists?`.
This change will remove the catching a `RangeError`.
|
|
|
|
| |
Fix failing tests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 04ac5655be91f49cd4dfe2838df96213502fb274 I assumed that we would
never want to pass the "table_name.column_name" form to where with a
symbol. However, in Ruby 2.2 and later, you can quote symbols using the
new hash syntax, so it's a semi-reasonable thing to do if we want to
support the dot notation (which I'd rather deprecate, but that would be
too painful of a migration).
Instead we've changed the definition of "this is a table name with a
dot" to when the value associated is a hash. It would make very little
sense to write `where("table_name.column_name": { foo: :bar })` in any
scenario (other than equality for a JSON column which we don't support
through `where` in this way).
Close #24514.
|
| |
|
| |
|