- 17 2月, 2016 1 次提交
-
-
由 Prathamesh Sonpatki 提交于
- Previously it used to show error message <"undefined method `limit_value' for {:title=>\"Rails\"}:Hash"> - Now it shows following error message. >> Post.where.not(name: 'DHH').or(name: 'Tenderlove') ArgumentError: You have passed Hash object to #or. Pass an ActiveRecord::Relation object instead. - Fixes #23714.
-
- 13 2月, 2016 1 次提交
-
-
由 Bogdan Gusiev 提交于
instead of loading the relation into memory
-
- 04 2月, 2016 2 次提交
-
-
由 Matthew Draper 提交于
-
由 Matthew Draper 提交于
This still isn't as separated as I'd like, but it at least moves most of the burden of alias mapping in one place.
-
- 27 1月, 2016 1 次提交
-
-
由 Bogdan Gusiev 提交于
Raises when #reverse_order can not process SQL order instead of making invalid SQL before this patch
-
- 13 1月, 2016 1 次提交
-
-
由 Rafael Mendonça França 提交于
When you are using scopes and you chaining these scopes it is hard to know which are the values that are incompatible. This way you can read the message and know for which values you need to look for. [Herminio Torres]
-
- 05 1月, 2016 1 次提交
-
-
由 Tamir Duberstein 提交于
-
- 31 12月, 2015 1 次提交
-
-
由 Tim Sandberg 提交于
-
- 15 12月, 2015 3 次提交
-
-
由 yuuji.yaginuma 提交于
``` # before DEPRECATION WARNING: Time columns will become time zone aware in Rails 5.1. This still causes `String`s to be parsed as if they were in `Time.zone`, and `Time`s to be converted to `Time.zone`. To keep the old behavior, you must add the following to your initializer: config.active_record.time_zone_aware_types = [:datetime] To silence this deprecation warning, add the following: config.active_record.time_zone_aware_types << :time ``` ``` # after DEPRECATION WARNING: Time columns will become time zone aware in Rails 5.1. This still causes `String`s to be parsed as if they were in `Time.zone`, and `Time`s to be converted to `Time.zone`. To keep the old behavior, you must add the following to your initializer: config.active_record.time_zone_aware_types = [:datetime] To silence this deprecation warning, add the following: config.active_record.time_zone_aware_types << :time ```
-
由 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.
-
由 Sean Griffin 提交于
Some backends allow `LIMIT 1,2` as a shorthand for `LIMIT 1 OFFSET 2`. Supporting this in Active Record massively complicates using bind parameters for limit and offset, and it's trivially easy to build an invalid SQL query by also calling `offset` on the same `Relation`. This is a niche syntax that is only supported by a few adapters, and can be trivially worked around by calling offset explicitly.
-
- 14 12月, 2015 2 次提交
-
-
由 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.
-
由 Sean Griffin 提交于
Some backends allow `LIMIT 1,2` as a shorthand for `LIMIT 1 OFFSET 2`. Supporting this in Active Record massively complicates using bind parameters for limit and offset, and it's trivially easy to build an invalid SQL query by also calling `offset` on the same `Relation`. This is a niche syntax that is only supported by a few adapters, and can be trivially worked around by calling offset explicitly.
-
- 26 11月, 2015 1 次提交
-
-
由 Jared Beck 提交于
[ci skip]
-
- 04 11月, 2015 1 次提交
-
-
由 Thomas Walpole 提交于
Add AC::Parameters tests for WhereChain#not
-
- 02 11月, 2015 1 次提交
-
- 31 10月, 2015 1 次提交
-
-
由 Takashi Kokubun 提交于
-
- 25 10月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 18 10月, 2015 2 次提交
-
-
由 Rafael Mendonça França 提交于
This reverts commit 4d8f62dc. Reason: This broke the build. Please recommit again when it is green.
- 17 10月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
`WhereClauseFactory` handles all other branches based on argument types, so the code fits more naturally here, and it's just where the responsibility belongs.
-
- 16 10月, 2015 1 次提交
-
-
由 Jake Worth 提交于
[#20473]
-
- 14 10月, 2015 1 次提交
-
-
由 Yves Senn 提交于
The focus of this change is to make the API more accessible. References to method and classes should be linked to make it easy to navigate around. This patch makes exzessiv use of `rdoc-ref:` to provide more readable docs. This makes it possible to document `ActiveRecord::Base#save` even though the method is within a separate module `ActiveRecord::Persistence`. The goal here is to bring the API closer to the actual code that you would write. This commit only deals with Active Record. The other gems will be updated accordingly but in different commits. The pass through Active Record is not completely finished yet. A follow up commit will change the spots I haven't yet had the time to update. /cc @fxn
-
- 13 10月, 2015 2 次提交
-
-
由 Yves Senn 提交于
The rdoc parser seems to trip on the `private def` construct. Public methods following a method defined with `private def` are not visible inside the module docs but are appended to the top-most module. For example the method `ActiveRecord::QueryMethods#distinct` was listed under `ActiveRecord#distinct`. /cc @sgrif
-
由 Yves Senn 提交于
Also unify the format of code example output. Only use `# =>` if the actual return value is described. Otherwise simply use `#`. Conflicts: activerecord/lib/active_record/relation/query_methods.rb
-
- 08 10月, 2015 1 次提交
-
- 02 10月, 2015 1 次提交
-
-
由 Guo Xiang Tan 提交于
-
- 26 9月, 2015 2 次提交
-
-
由 amitkumarsuroliya 提交于
-
由 amitkumarsuroliya 提交于
-
- 22 9月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
Fixes #21488 [Sean Griffin & johanlunds]
-
- 05 9月, 2015 1 次提交
-
-
由 Samuel Williams 提交于
Sometimes opts passed in might respond to ==, e.g. `Arel::Nodes::Grouping`. In this case, `opts == :chain` returns `Arel::Nodes::Equality` which causes odd behaviour. Prefer `if :chain == opts` which guarantees that `Symbol#==` would be invoked. Alternatively consider `eql?`.
-
- 20 6月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
After discussing, we've decided it makes more sense to include it. We're already forwarding every conflicting method to `to_a`, and there's no conflation of concerns. `Enumerable` has no mutating methods, and it just allows us to simplify the code. No existing methods will have a change in behavior. Un-overridden Enumerable methods will simply delegate to `each`. [Sean Griffin & bogdan]
-
- 31 5月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
Our general contract in Active Record is that strings are assumed to be SQL literals, and symbols are assumed to reference a column. If a from clause is given, we shouldn't include the table name, but we should still quote the value as if it were a column. Upon fixing this, the tests were still failing on SQLite. This was because the column name being returned by the query was `"\"join\""` instead of `"join"`. This is actually a bug in SQLite that was fixed a long time ago, but I was using the version of SQLite included by OS X which has this bug. Since I'm guessing this will be a common case for contributors, I also added an explicit check with a more helpful error message. Fixes #20360
-
- 26 5月, 2015 1 次提交
-
-
由 Yves Senn 提交于
See #9683 for the reasons we switched to `distinct`. Here is the discussion that triggered the actual deprecation #20198. `uniq`, `uniq!` and `uniq_value` are still around. They will be removed in the next minor release after Rails 5.
-
- 19 5月, 2015 1 次提交
-
-
由 Florian Thomas 提交于
Example: User.left_outer_joins(:posts) => SELECT "users".* FROM "users" LEFT OUTER JOIN "posts" ON "posts"."user_id" = "users"."id"
-
- 25 2月, 2015 2 次提交
-
-
由 Jeremy Kemper 提交于
Fix c4794806 to account for from_value -> from_clause in bdc51416
-
由 Rafael Mendonça França 提交于
Fix appending table_name to select and group when used with subquery (fr...
-
- 29 1月, 2015 3 次提交
-
-
由 Bogdan Gusiev 提交于
-
由 Sean Griffin 提交于
-
由 Matthew Draper 提交于
Post.where('id = 1').or(Post.where('id = 2')) # => SELECT * FROM posts WHERE (id = 1) OR (id = 2) [Matthew Draper & Gael Muller]
-