1. 13 3月, 2015 1 次提交
    • J
      Return true from head method · d5efb1f9
      Joel Hayhurst 提交于
      It was returning false in normal circumstances.
      This broke the `head :ok and return if` construct.
      Add appropriate test.
      d5efb1f9
  2. 06 3月, 2015 1 次提交
  3. 05 3月, 2015 3 次提交
  4. 04 3月, 2015 1 次提交
  5. 03 3月, 2015 1 次提交
  6. 28 2月, 2015 1 次提交
  7. 19 2月, 2015 1 次提交
  8. 16 2月, 2015 2 次提交
  9. 13 2月, 2015 1 次提交
  10. 11 2月, 2015 3 次提交
    • C
      Accept a collection in fresh_when and stale? · 050fda02
      claudiob 提交于
      The methods `fresh_when` and `stale?` from ActionController::ConditionalGet
      accept a single record as a short form for a hash. For instance
      
      ```ruby
        def show
          @article = Article.find(params[:id])
          fresh_when(@article)
        end
      ```
      
      is just a short form for:
      
      ```ruby
        def show
          @article = Article.find(params[:id])
          fresh_when(etag: @article, last_modified: @article.created_at)
        end
      ```
      
      This commit extends `fresh_when` and `stale?` to also accept a collection
      of records, so that a short form similar to the one above can be used in
      an `index` action. After this commit, the following code:
      
      ```ruby
      def index
        @article = Article.all
        fresh_when(etag: @articles, last_modified: @articles.maximum(:created_at))
      end
      ```
      
      can be simply written as:
      
      ```ruby
      def index
        @article = Article.all
        fresh_when(@articles)
      end
      ```
      050fda02
    • C
      Fix wrong kwarg "record" from #18872 · c7331e05
      claudiob 提交于
      PR #18772 changed the parameters of `stale?` to use `kwargs`.
      [As for this comment](https://github.com/rails/rails/pull/18872/files#r24456288)
      the default value for the `etag` parameter should be `record`, not `nil`.
      
      This commit fixes the code and introduces a test that:
      
      - passed before #18872
      - fails on the current master (after #18772)
      - passes again after setting the default value of `etag` to `record`.
      c7331e05
    • K
      7a78c251
  11. 24 1月, 2015 1 次提交
  12. 22 1月, 2015 4 次提交
  13. 09 1月, 2015 1 次提交
  14. 07 1月, 2015 2 次提交
  15. 06 1月, 2015 1 次提交
  16. 05 1月, 2015 4 次提交
  17. 31 12月, 2014 3 次提交
    • R
      Correctly use the response's status code calling head · 7ef7f1cc
      Robin Dupret 提交于
      Commit 20fece14 introduced the `_status_code` method to fix calls to
      `head :ok`. This method has been added on both ActionController::Metal
      and ActionDispatch::Response.
      
      As for the latter, this method is just equivalent to the `response_code`
      one so commit aefec3c6 removed it from the `Reponse` object so call to
      the `_status_code` method on an ActionController::Base instance would be
      handled by the `Metal` class (which `Base` inherits from) but the status
      code is not updated according to the response at this level.
      
      The fix is to actually rely on `response_code` for ActionController::Base
      instances but this method doesn't exist for bare Metal controllers so we
      need to define it.
      7ef7f1cc
    • A
      stop referencing `env` in url_for · 4080dd2f
      Aaron Patterson 提交于
      encapsulate env in the request so that we can eventually move away from
      the env hash
      4080dd2f
    • A
      use methods on the request rather than direct hash access · 87a75910
      Aaron Patterson 提交于
      this will help decouple us from using the rack env hash
      87a75910
  18. 30 12月, 2014 1 次提交
  19. 29 12月, 2014 2 次提交
  20. 20 12月, 2014 1 次提交
  21. 19 12月, 2014 1 次提交
  22. 18 12月, 2014 1 次提交
  23. 12 12月, 2014 2 次提交
  24. 11 12月, 2014 1 次提交