- 13 4月, 2016 1 次提交
-
-
由 Sean Griffin 提交于
In 04ac5655 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.
-
- 28 2月, 2016 4 次提交
-
-
由 Brian Christian 提交于
-
由 Brian Christian 提交于
-
由 Brian Christian 提交于
-
由 Brian Christian 提交于
-
- 23 2月, 2016 1 次提交
-
-
- 13 2月, 2016 2 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Bogdan Gusiev 提交于
instead of loading the relation into memory
-
- 02 2月, 2016 1 次提交
-
-
由 Sean Griffin 提交于
This reverts commit 9f3730a5, reversing changes made to 2637fb75. There are additional issues with this commit that need to be addressed before this change is ready (see #23377). This is a temporary revert in order for us to have more time to address the issues with that PR, without blocking the release of beta2.
-
- 28 1月, 2016 1 次提交
-
-
由 Bogdan Gusiev 提交于
instead of loading relation
-
- 19 12月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
Fix `test_find_with_order_on_included_associations_with_construct_finder_sql_for_association_limiting_and_is_distinct` to NULL-agnostic way The sort order of NULL depends on the RDBS implementation. This commit is to fix the test to NULL-agnostic way. Example: ``` activerecord_unittest=# SELECT DISTINCT "posts"."id", author_addresses_authors.id AS alias_0 FROM "posts" LEFT OUTER JOIN "authors" ON "authors"."id" = "posts"."author_id" LEFT OUTER JOIN "author_addresses" ON "author_addresses"."id" = "authors"."author_address_id" LEFT OUTER JOIN "categorizations" ON "categorizations"."category_id" = "posts"."id" LEFT OUTER JOIN "authors" "authors_posts" ON "authors_posts"."id" = "categorizations"."author_id" LEFT OUTER JOIN "author_addresses" "author_addresses_authors" ON "author_addresses_authors"."id" = "authors_posts"."author_address_id" ORDER BY author_addresses_authors.id DESC; id | alias_0 ----+--------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 1 | 1 (12 rows) ``` ``` root@localhost [activerecord_unittest] > SELECT DISTINCT `posts`.`id`, author_addresses_authors.id AS alias_0 FROM `posts` LEFT OUTER JOIN `authors` ON `authors`.`id` = `posts`.`author_id` LEFT OUTER JOIN `author_addresses` ON `author_addresses`.`id` = `authors`.`author_address_id` LEFT OUTER JOIN `categorizations` ON `categorizations`.`category_id` = `posts`.`id` LEFT OUTER JOIN `authors` `authors_posts` ON `authors_posts`.`id` = `categorizations`.`author_id` LEFT OUTER JOIN `author_addresses` `author_addresses_authors` ON `author_addresses_authors`.`id` = `authors_posts`.`author_address_id` ORDER BY author_addresses_authors.id DESC; +----+---------+ | id | alias_0 | +----+---------+ | 1 | 1 | | 3 | NULL | | 1 | NULL | | 2 | NULL | | 4 | NULL | | 5 | NULL | | 6 | NULL | | 7 | NULL | | 8 | NULL | | 9 | NULL | | 10 | NULL | | 11 | NULL | +----+---------+ 12 rows in set (0.00 sec) ```
-
- 18 12月, 2015 1 次提交
-
-
由 Matthew Draper 提交于
We know the query will return exactly one row for each entry in the `ids` array, so we can do all the limit/offset calculations on that array, in advance. I also split our new ordered-ids behaviour out of the existing `find_some` method: especially with this change, the conditionals were overwhelming the actual logic.
-
- 15 12月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
We currently generate an unbounded number of prepared statements when `limit` or `offset` are called with a dynamic argument. This changes `LIMIT` and `OFFSET` to use bind params, eliminating the problem. `Type::Value#hash` needed to be implemented, as it turns out we busted the query cache if the type object used wasn't exactly the same object. This drops support for passing an `Arel::Nodes::SqlLiteral` to `limit`. Doing this relied on AR internals, and was never officially supported usage. Fixes #22250.
-
- 14 12月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
We currently generate an unbounded number of prepared statements when `limit` or `offset` are called with a dynamic argument. This changes `LIMIT` and `OFFSET` to use bind params, eliminating the problem. `Type::Value#hash` needed to be implemented, as it turns out we busted the query cache if the type object used wasn't exactly the same object. This drops support for passing an `Arel::Nodes::SqlLiteral` to `limit`. Doing this relied on AR internals, and was never officially supported usage. Fixes #22250.
-
- 21 11月, 2015 1 次提交
-
-
由 yui-knk 提交于
`replace_named_bind_variables` and `replace_bind_variables` are definded in `sanitization.rb`, so it is reasonable these tests are on `sanitize_test.rb`.
-
- 06 10月, 2015 1 次提交
-
-
由 akihiro17 提交于
In this commit, find_by doesn't cache arguments so that find_by with association subquery works correctly. Fixes #20817
-
- 23 9月, 2015 1 次提交
-
-
由 yui-knk 提交于
-
- 17 9月, 2015 1 次提交
-
-
由 Ronak Jangir 提交于
-
- 09 9月, 2015 1 次提交
-
-
由 Rafael Mendonça França 提交于
This reverts commit d5ba9a42, reversing changes made to 30c50339. Reason: This generate the dynalic finders more than one time
-
- 08 8月, 2015 1 次提交
-
-
由 Miguel Grazziotin 提交于
-
- 20 6月, 2015 1 次提交
-
-
由 Miguel Grazziotin 提交于
-
- 06 6月, 2015 1 次提交
-
-
由 Miguel Grazziotin 提交于
do not change the order of the result if the object was already ordered by the user via :order clause
-
- 04 6月, 2015 2 次提交
-
-
由 Miguel Grazziotin 提交于
-
由 Miguel Grazziotin 提交于
-
- 30 5月, 2015 1 次提交
-
-
由 Miguel Grazziotin 提交于
-
- 09 5月, 2015 1 次提交
-
-
由 Rob Looby 提交于
-
- 23 3月, 2015 1 次提交
-
-
由 Gaurav Sharma 提交于
-
- 05 1月, 2015 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 23 12月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
If there is a method defined such as `find_and_do_stuff(id)`, which then gets called on an association, we will perform statement caching and the parent ID will not change on subsequent calls. Fixes #18117
-
- 05 12月, 2014 1 次提交
-
-
由 Melanie Gilman 提交于
-
- 04 12月, 2014 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 03 12月, 2014 1 次提交
-
-
由 Melanie Gilman 提交于
This ensures that we're handling all forms of nested tables the same way. We're aware that the `convert_dot_notation_to_hash` method will cause a performance hit, and we intend to come back to it once we've refactored some of the surrounding code. [Melissa Xie & Melanie Gilman]
-
- 29 11月, 2014 1 次提交
-
-
由 Erik Michaels-Ober 提交于
-
- 14 11月, 2014 1 次提交
-
-
由 Arun Agrawal 提交于
`Computer` class needs to be require See #17217 for more details
-
- 03 11月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
We should not behave differently just because a class has a default scope.
-
- 01 11月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
Sufficiently large integers cause `find` and `find_by` to raise `StatementInvalid` instead of `RecordNotFound` or just returning `nil`. Given that we can't cast to `nil` for `Integer` like we would with junk data for other types, we raise a `RangeError` instead, and rescue in places where it would be highly unexpected to get an exception from casting. Fixes #17380
-
- 20 9月, 2014 1 次提交
-
-
由 Godfrey Chan 提交于
For now, we will just skip the cache when a non-column key is used in the hash. If the future, we can probably move some of the logic in PredicateBuilder.expand up the chain to make caching possible for association queries. Closes #16903 Fixes #16884
-
- 07 9月, 2014 1 次提交
-
-
由 Cristian Bica 提交于
`User.where(id: [[1,2],3])` was equal to `User.where(id:[1, 2, 3])` in Rails 4.1.x but because of some refactoring in Arel this stopped working in 4.2.0. This fixes it in Rails. [Dan Olson & Cristian Bica]
-
- 26 8月, 2014 2 次提交
-
-
由 Godfrey Chan 提交于
-
由 Godfrey Chan 提交于
* Also duplicated find_by tests from relations_test.rb to finder_test.rb now that we have a completely different implementation on the class (in core.rb with AST caching stuff). * Also removed a (failing) test that used mocks. Now that we have tests for the behavior, there's no point having another test that tests the implementation (that it delegates). Further, what the test was implying is nolonger true with the current implementation, because Class.find_by is a real method now.
-