- 11 1月, 2018 1 次提交
-
-
由 Ryuta Kamizono 提交于
`relation.exists?` just wants to know if there is a result or not, does not need the exact records matched. Therefore, an intermediate SELECT query for eager loading is not necessary.
-
- 10 1月, 2018 1 次提交
-
-
由 Brian Christian 提交于
-
- 07 1月, 2018 3 次提交
-
-
由 Ryuta Kamizono 提交于
We can use `relation.last(index)[-index]` instead of loading all records when using reversible order because `last` will call `reverse_order`.
-
由 Ryuta Kamizono 提交于
Currently `last` with `offset` behaves incorrectly because `offset` can not be reversed like `limit`. Therefore, `offset` should also be handled like `limit`.
-
由 Ryuta Kamizono 提交于
-
- 28 11月, 2017 1 次提交
-
-
- 26 11月, 2017 1 次提交
-
-
由 Nikita Misharin 提交于
-
- 14 11月, 2017 1 次提交
-
-
由 Nikolai B 提交于
Make it clear that `exists?` can be chained onto a relation
-
- 06 11月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Fixes #30315.
-
- 09 10月, 2017 3 次提交
-
-
由 Ryuta Kamizono 提交于
I don't think this is a good abstraction because the internal method is used only if the relation need to be applied join dependency.
-
由 Ryuta Kamizono 提交于
`relation.exists?` should reference correct aliases while joining tables of has_many through associations.
-
由 Ryuta Kamizono 提交于
-
- 08 10月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
This is preparation to respect parent relation's alias tracking for fixing #30681.
-
- 14 9月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Because `quoted_table_name` doesn't respect table alias. We should use `arel_attribute` for that, so I added `column_name_from_arel_node` to generate column name from an arel node.
-
- 25 8月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
This regression was caused by caa178c1. The block for `set_inverse_instance` should also be passed to join dependency. Fixes #30402.
-
- 29 7月, 2017 1 次提交
-
-
由 Gaurish Sharma 提交于
This builds on top of 15e2da65. now it also returns exact Ids which were not found which will be debugging simple.
-
- 24 7月, 2017 1 次提交
-
-
由 Sean Griffin 提交于
A common source of bugs and code bloat within Active Record has been the need for us to maintain the list of bind values separately from the AST they're associated with. This makes any sort of AST manipulation incredibly difficult, as any time we want to potentially insert or remove an AST node, we need to traverse the entire tree to find where the associated bind parameters are. With this change, the bind parameters now live on the AST directly. Active Record does not need to know or care about them until the final AST traversal for SQL construction. Rather than returning just the SQL, the Arel collector will now return both the SQL and the bind parameters. At this point the connection adapter will have all the values that it had before. A bit of this code is janky and something I'd like to refactor later. In particular, I don't like how we're handling associations in the predicate builder, the special casing of `StatementCache::Substitute` in `QueryAttribute`, or generally how we're handling bind value replacement in the statement cache when prepared statements are disabled. This also mostly reverts #26378, as it moved all the code into a location that I wanted to delete. /cc @metaskills @yahonda, this change will affect the adapters Fixes #29766. Fixes #29804. Fixes #26541. Close #28539. Close #24769. Close #26468. Close #26202. There are probably other issues/PRs that can be closed because of this commit, but that's all I could find on the first few pages.
-
- 20 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 18 7月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Without this fix, `JoinDependency` doesn't use a custom table alias: ``` % ARCONN=sqlite3 be ruby -w -Itest test/cases/relations_test.rb -n test_using_a_custom_table_with_joins_affects_the_wheres Using sqlite3 Run options: -n test_using_a_custom_table_with_joins_affects_the_wheres --seed 14531 E Error:RelationTest#test_using_a_custom_table_with_joins_affects_the_wheres: ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: posts.author_id: SELECT "omg_posts".* FROM "posts" "omg_posts" INNER JOIN "authors" ON "authors"."id" = "posts"."author_id" WHERE "omg_posts"."title" = ? LIMIT ? ```
-
- 17 7月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
`arel_engine` is only used in `raise_record_not_found_exception!` to use `engine.connection` (and `connection.visitor`) in `arel.where_sql`. https://github.com/rails/arel/blob/v8.0.0/lib/arel/select_manager.rb#L183 But `klass.connection` will work as expected even if not using `arel_engine` (described by `test_connection`). So `arel_engine` is no longer needed.
-
- 06 7月, 2017 1 次提交
-
-
由 Eugene Kenny 提交于
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.
-
- 02 7月, 2017 1 次提交
-
-
由 Matthew Draper 提交于
This reverts commit 3420a145, reversing changes made to afb66a5a.
-
- 01 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 29 6月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
The delegation was needed since passing `relation` with `relation.bound_attributes`. It should use `relation.arel` in that case.
-
- 24 6月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 20 6月, 2017 1 次提交
-
-
由 Pat Allan 提交于
-
- 15 6月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
If a connection adapter overrides `select_*` methods, query caching will doesn't work. This patch changes `select_value` to `select_one` in `Relation#exists?` to ensure query caching. Fixes #29449.
-
- 11 5月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Fixes #29025.
-
- 10 4月, 2017 1 次提交
-
-
由 Boris Slobodin 提交于
-
- 09 4月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
To ease to customize a relation for `exists?`.
-
- 04 4月, 2017 1 次提交
-
-
由 Rafael Mendonça França 提交于
This reverts commit a680a581, reversing changes made to 842f67dd. Reason: I can't resist to the joke, so better to keep it there https://github.com/rails/rails/pull/28598#issuecomment-290945339.
-
- 29 3月, 2017 1 次提交
-
-
由 Winfred Nadeau 提交于
silly method gets a silly doc fix, or I'm missing an even sillier joke and I'm about to get schooled. BUT I'm pretty sure this is some serious Beaudrillard simulacrum, though. I'm just doing my part to spread the gospel of Douglas Adams.
-
- 26 2月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
If the `index` exceeds a `limit`, simply return an empty result without querying the database.
-
由 kami-zh 提交于
-
- 31 1月, 2017 1 次提交
-
-
由 Kevin Huang 提交于
-
- 04 1月, 2017 1 次提交
-
-
由 Rafael Mendonça França 提交于
find and exists?
-
- 30 12月, 2016 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 29 12月, 2016 1 次提交
-
-
由 Rafael Mendonça França 提交于
Some methods were added to public API in 5b14129d and they should be not part of the public API.
-
- 24 12月, 2016 1 次提交
-
-
由 Akira Matsuda 提交于
-