1. 26 2月, 2017 2 次提交
    • 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
    • A
      Commit flash changes when using a redirect route. · 558336ee
      Andrew White 提交于
      In ca324a0d the flash middleware was effectively removed by its
      constructor returning the app it was passed and the `commit_flash`
      call was moved to the `ActionController::Metal#dispatch` method.
      This broke any redirect routes that modified the flash because the
      redirect happens before `dispatch` gets called.
      
      To fix it, this commit adds a `commit_flash` call in the `serve`
      method of `ActionDispatch::Routing::Redirect`.
      
      Fixes #27992.
      558336ee
  2. 25 2月, 2017 21 次提交
  3. 24 2月, 2017 17 次提交