1. 25 7月, 2017 1 次提交
  2. 21 7月, 2017 1 次提交
  3. 30 5月, 2017 1 次提交
  4. 27 5月, 2017 1 次提交
  5. 12 5月, 2017 1 次提交
  6. 26 4月, 2017 1 次提交
  7. 10 4月, 2017 2 次提交
  8. 21 3月, 2017 1 次提交
  9. 19 3月, 2017 1 次提交
    • R
      Use `load` rather than `collect` for force loading · 59db5f22
      Ryuta Kamizono 提交于
      Since b644964b `ActiveRecord::Relation` includes `Enumerable` so
      delegating `collect`, `all?`, and `include?` are also unneeded.
      `collect` without block returns `Enumerable` without preloading by that.
      We should use `load` rather than `collect` for force loading.
      59db5f22
  10. 18 3月, 2017 1 次提交
    • R
      Delegate `uniq` to `records` · cf4f05a7
      Ryuta Kamizono 提交于
      This fixes CI failure due to 48f3be8c.
      
      `Enumerable#uniq` was introduced since Ruby 2.4. We should delegate
      `uniq` to `records` explicitly.
      
      And since b644964b `ActiveRecord::Relation` includes `Enumerable` so
      delegating `map` is unneeded.
      cf4f05a7
  11. 10 3月, 2017 2 次提交
  12. 27 2月, 2017 1 次提交
    • E
      Allow order to be given expressions as hash keys · 6cf4835b
      Eugene Kenny 提交于
      When `order` is given a hash, the keys are currently assumed to be
      attribute names and are quoted as such in the query, which makes it
      impossible to pass an expression instead:
      
          Post.order("LENGTH(title)" => :asc).last
          # SELECT  `posts`.* FROM `posts` ORDER BY `posts`.`LENGTH(title)` DESC LIMIT 1
      
      If the key is an `Arel::Nodes::SqlLiteral`, we now use it directly in
      the query. This provides a way to build a relation with a complex order
      clause that can still be reversed with `reverse_order` or `last`.
      6cf4835b
  13. 26 2月, 2017 5 次提交
    • E
      Include selects in group query with having clause · 18125683
      Eugene Kenny 提交于
      When a grouped calculation contains a having clause that references a
      selected value, we need to include that selected value in the query.
      
      Postgres doesn't support referencing a selected value in a having
      clause, but other databases do; we can skip the test on the pg adapter
      but run it for the others.
      
      This was fixed before in 9a298a16, but
      the test coverage was lost in 5a05207d.
      The fix regressed in 6311975f and was
      removed in 97d46c17.
      18125683
    • R
      Fix `find_nth` with `limit_value` · 84f4ab90
      Ryuta Kamizono 提交于
      If the `index` exceeds a `limit`, simply return an empty result without
      querying the database.
      84f4ab90
    • R
      Remove useless `select_values += select_values` · 97d46c17
      Ryuta Kamizono 提交于
      `select_values` is a local variable defined at previous line.
      `select_values += select_values` is totally useless.
      97d46c17
    • K
      Remove duplicated private method · 0737dc8d
      kami-zh 提交于
      0737dc8d
    • R
      Suppress `DISTINCT` clause outside aggregate function · d38e5d27
      Ryuta Kamizono 提交于
      `DISTINCT` clause is applied inside aggregate function by
      `operation_over_aggregate_column` if needed. Unneeded outside aggregate
      function.
      
      ```ruby
        # Before
        author.unique_categorized_posts.count
        # => SELECT DISTINCT COUNT(DISTINCT "posts"."id") FROM "posts" INNER JOIN "categorizations" ON "posts"."id" = "categorizations"."post_id" WHERE "categorizations"."author_id" = ?  [["author_id", 2]]
      
        # After
        author.unique_categorized_posts.count
        # => SELECT COUNT(DISTINCT "posts"."id") FROM "posts" INNER JOIN "categorizations" ON "posts"."id" = "categorizations"."post_id" WHERE "categorizations"."author_id" = ?  [["author_id", 2]]
      ```
      
      Closes #27615
      d38e5d27
  14. 13 2月, 2017 1 次提交
  15. 07 2月, 2017 2 次提交
  16. 04 2月, 2017 1 次提交
  17. 31 1月, 2017 1 次提交
  18. 05 1月, 2017 2 次提交
  19. 04 1月, 2017 2 次提交
  20. 31 12月, 2016 1 次提交
  21. 30 12月, 2016 5 次提交
  22. 29 12月, 2016 1 次提交
  23. 25 12月, 2016 1 次提交
  24. 24 12月, 2016 2 次提交
  25. 23 12月, 2016 1 次提交
  26. 06 12月, 2016 1 次提交