- 24 5月, 2014 1 次提交
-
-
由 Sergey Alekseev 提交于
It seems that #where! is not designed to be used as a chained where. See initial implementation at 8c2c6051. So, no need to check twice. We should not test #where! https://github.com/rails/rails/pull/15285#discussion_r13018316
-
- 23 5月, 2014 1 次提交
-
-
由 Paul Nikitochkin 提交于
-
- 25 4月, 2014 1 次提交
-
-
由 Yves Senn 提交于
/cc @tenderlove
-
- 22 4月, 2014 1 次提交
-
-
由 Earl J St Sauver 提交于
Fixes #14752 Select mimics the block interface of arrays, but does not mock the block interface for select!. This change moves the api to be a private method, _select!.
-
- 08 4月, 2014 1 次提交
-
-
由 Lauro Caetano 提交于
The reverse_order method was using a flag to control if the order should be reversed or not. Instead of using this variable just build the reverse order inside its proper method. This implementation was leading to an unexpected behavior when using reverse_order and then applying reorder(nil). Example: Before Post.order(:name).reverse_order.reorder(nil) # => SELECT "posts".* FROM "posts" ORDER BY "posts"."id" DESC After Post.order(:name).reverse_order.reorder(nil) # => SELECT "posts".* FROM "posts"
-
- 18 3月, 2014 1 次提交
-
-
由 Earl St Sauver 提交于
The group method also takes an array, however this isn't immediately clear by reading the source since it delegates this method. If you trace it back to the AREL building you can see that it does support an array. Shoutout to @betovelandia for pointing this out.
-
- 17 3月, 2014 1 次提交
-
-
由 Yves Senn 提交于
Closes #14406.
-
- 15 3月, 2014 1 次提交
-
-
由 Steven Harman 提交于
-
- 05 3月, 2014 3 次提交
-
-
由 Yves Senn 提交于
This is a result of the discussion at https://github.com/rails/rails/pull/14263/files#r10291489
-
由 Marcelo Casiraghi 提交于
This behavior has almost no performance impact: String not allowed 66.910000 0.030000 66.940000 ( 67.024976) String allowed 69.360000 0.030000 69.390000 ( 69.503096) Benchmarked with http://git.io/Y0YuRw.
- 01 3月, 2014 1 次提交
-
-
由 Kuldeep Aggarwal 提交于
-
- 17 2月, 2014 2 次提交
-
-
由 Rafael Mendonça França 提交于
This reverts commit 3ea84035, reversing changes made to e4cde5d5. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/relation/query_methods.rb Reason: using `from` without `select` should not change the select list to SELECT * because it can lead different query results. If it is needed to change the table to a subquery or a view you can pass a table alias in the `from` call or use `select('subquery.*')`. Fixes #14049.
-
由 Rafael Mendonça França 提交于
-
- 02 2月, 2014 1 次提交
-
-
由 Rafael Mendonça França 提交于
Since its conception arel was made to be private API of Active Record. If users want to use arel features directly we should provide a way using the Active Record API without exposing the arel implementation.
-
- 31 1月, 2014 1 次提交
-
-
由 Washington Luiz 提交于
-
- 30 1月, 2014 1 次提交
-
-
由 Yves Senn 提交于
There is no gain in `referencing` tables that are not used for preloading. Furthermore it will break if polymorphic associations are invloved. This is because `references_eager_loaded_tables?` uses all `reference_values` to decide wether to `eager_load` or `preload`.
-
- 29 1月, 2014 1 次提交
-
-
由 Tsutomu Kuroda 提交于
With this we can write `Model#select(:aliased)`, `Model#order(:aliased)`, `Model#reoder(aliased: :desc)`, etc. Supplementary work to 54122067.
-
- 27 1月, 2014 1 次提交
-
-
由 Washington Luiz 提交于
Hopefully make it easier to debug errors. e.g Before: RuntimeError: unscope(where: "deleted_at") failed: unscoping String is unimplemented. After: RuntimeError: unscope(where: "deleted_at") failed: unscoping String "'t'='t'" is unimplemented.
-
- 22 1月, 2014 1 次提交
-
-
由 Yves Senn 提交于
This fixes a bug where `select(:id)` combined with `joins()` raised: ``` ActiveRecord::StatementInvalid: SQLite3::SQLException: ambiguous column name: id: SELECT id, authors.author_address_id FROM "posts" INNER JOIN "authors" ON "authors"."id" = "posts"."author_id" ORDER BY posts.id LIMIT 3 ``` The `select_values` are still String and Symbols because other parts (mainly calculations.rb) rely on that fact. /cc @tenderlove
-
- 18 1月, 2014 1 次提交
-
-
由 Rafael Mendonça França 提交于
The code duplication was removed and this comment is pointing to the wrong line. [ci skip]
-
- 16 1月, 2014 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 15 1月, 2014 5 次提交
-
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
- 14 1月, 2014 8 次提交
-
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
It's not public API, but is not private scoped.
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
- 30 12月, 2013 1 次提交
-
-
由 Kuldeep Aggarwal 提交于
-
- 20 12月, 2013 1 次提交
-
-
由 Cody Cutrer 提交于
-
- 18 12月, 2013 1 次提交
-
-
由 Akshay Vishnoi 提交于
-
- 16 12月, 2013 1 次提交
-
-
由 Akshay Vishnoi 提交于
-
- 21 11月, 2013 1 次提交
-
-
由 Jon Leighton 提交于
I'm pretty confused about the addition of this method. The documentation says that it was intended to allow the removal of values from the default scope (in contrast to #except). However it behaves exactly the same as except: https://gist.github.com/jonleighton/7537008 (other than having a slightly enhanced syntax). The removal of the default scope is allowed by 94924dc3, which was not a change we could make until 4.1 due to the need to deprecate things. However after that change #unscope still gives us nothing that #except doesn't already give us. However there *is* a desire to be able to unscope stuff in a way that persists across merges, which would allow associations to be defined which unscope stuff from the default scope of the associated model. E.g. has_many :comments, -> { unscope where: :trashed } So that's what this change implements. I've also corrected the documentation. I removed the guide references to #except as I think unscope really supercedes #except now. While we're here, there's also a potential desire to be able to write this: has_many :comments, -> { unscoped } However, it doesn't make sense and would not be straightforward to implement. While with #unscope we're specifying exactly what we want to be removed from the relation, with "unscoped" we're just saying that we want it to not have some things which were added earlier on by the default scope. However in the case of an association, we surely don't want *all* conditions to be removed, otherwise the above would just become "SELECT * FROM comments" with no foreign key constraint. To make the above work, we'd have to somehow tag the relation values which get added when evaluating the default scope in order to differentiate them from other relation values. Which is way too much complexity and therefore not worth it when most use cases can be satisfied with unscope. Closes #10643, #11061.
-