1. 04 7月, 2018 1 次提交
    • E
      Use class_eval or instance_eval when triggering lazy load hooks: · 6cf7a0b0
      Edouard CHIN 提交于
      - When lazy load hooks were triggered we were using
        `Object.instance_eval` which evaluates the block in the context of
        the class being passed. Most of the time that class was a
        `Class`. If one wants to define a instance method on the class then
        it wasn't possible.
      
        ```ruby
          class A; end;
          A.instance_eval do
            def foo
              puts 'bar'
            end
          end
          A.new.foo #> NoMethodError: undefined method `foo`
          A.foo #> bar
        ```
      - This PR checks what object is passed when triggering the hooks and
        either call `class_eval` or `instance_eval`. My rational and assumptions being
        that if an instance of a class is passed, then the blocks needs to
        evaluate in the context of that instance (i.e. defining a method
        should only define it on that instance).
        On the other hand, if a Class or Module is passed when triggering
        hooks, then defining a method should define it on the class itself
      - #32776 Pushed me to introduce this change
      6cf7a0b0
  2. 22 6月, 2018 3 次提交
  3. 21 6月, 2018 7 次提交
  4. 20 6月, 2018 6 次提交
  5. 19 6月, 2018 9 次提交
  6. 18 6月, 2018 4 次提交
  7. 17 6月, 2018 1 次提交
  8. 16 6月, 2018 1 次提交
  9. 15 6月, 2018 4 次提交
  10. 14 6月, 2018 2 次提交
    • Y
    • D
      Add support for more HTTP cache controls · c94a0075
      Daniel Schierbeck 提交于
      From <https://tools.ietf.org/html/rfc5861>:
      
      > The stale-if-error HTTP Cache-Control extension allows a cache to
      > return a stale response when an error -- e.g., a 500 Internal Server
      > Error, a network segment, or DNS failure -- is encountered, rather
      > than returning a "hard" error.  This improves availability.
      >
      > The stale-while-revalidate HTTP Cache-Control extension allows a
      > cache to immediately return a stale response while it revalidates it
      > in the background, thereby hiding latency (both in the network and on
      > the server) from clients.
      
      These are useful, fully standardized parts of the HTTP protocol with
      widespread support among CDN vendors. Supporting them will make it
      easier to utilize reverse proxies and CDNs from Rails.
      c94a0075
  11. 13 6月, 2018 2 次提交