- 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 提交于
-
- 06 12月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Raise `ActiveRecord::RangeError` when values that executed are out of range.
-
- 24 11月, 2016 1 次提交
-
-
由 Dominic Cleal 提交于
9c9fb19b 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
-
- 09 11月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
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 ```
-
- 23 9月, 2016 1 次提交
-
-
由 v.promzelev 提交于
-
- 03 9月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
All indentation was normalized by rubocop auto-correct at 80e66cc4. But heredocs was still kept absolute position. This commit aligns heredocs indentation for consistency.
-
- 18 8月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Currently `CollectionProxy` inherits `Relation` therefore we can use its own methods rather than delegating to collection association.
-
- 16 8月, 2016 2 次提交
-
-
由 Ryuta Kamizono 提交于
Otherwise CollectionProxy's bang methdos cannot respect dirty target.
-
由 Rafael Mendonça França 提交于
Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
-
- 15 8月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
`find_nth` is protected method, therefore `offset` has not been passed anywhere. `find_nth_with_limit_and_offset` is unnecessary anymore because `offset` has not been passed.
-
- 14 8月, 2016 1 次提交
-
-
由 Michel Pigassou 提交于
When calling association.find RecordNotFound is now raised with the same argument as when we do it in Record.find (primary_key, id and model).
-
- 08 8月, 2016 1 次提交
-
-
由 Xavier Noria 提交于
Some case expressions remain, need to think about those ones.
-
- 07 8月, 2016 2 次提交
-
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
-
- 28 7月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 16 6月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
`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. aa062318 removes type casting in `build_relation` then a `RangeError` moves to `relation.exists?`. This change will remove the catching a `RangeError`.
-
- 13 6月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
`construct_relation_for_association_calculations` pass a string value to `construct_join_dependency` when setting a string value in `from`. It should not pass a string value, but always `joins_values`. Related #14834, #19452. Fixes #24193.
-
- 31 5月, 2016 1 次提交
-
-
由 Sean Griffin 提交于
Currently `exists?` does some hackery where it assumes that we can join onto anything that we passed to `eager_load` or `includes`, which doesn't work if we are joining onto a polymorphic association. Actually figuring out if we want to include something would require knowledge deep within the join dependency module, which is hard to pull up. The simplest solution is just to pass a flag down that says we're not actually going to try to eager load any of the data. It's not the solution I'd like, but that code really needs to be untangled before we can do much with it. This is another attempt at 6d5b1fdf which should address the concerns that led to reverting it in 4ecabed2.
-