1. 29 6月, 2017 1 次提交
  2. 28 6月, 2017 3 次提交
  3. 23 6月, 2017 1 次提交
  4. 20 6月, 2017 2 次提交
  5. 14 6月, 2017 1 次提交
  6. 12 6月, 2017 3 次提交
  7. 11 6月, 2017 2 次提交
  8. 10 6月, 2017 1 次提交
  9. 08 6月, 2017 1 次提交
  10. 07 6月, 2017 1 次提交
    • J
      Cache: write_multi (#29366) · 2b96d582
      Jeremy Daer 提交于
      Rails.cache.write_multi foo: 'bar', baz: 'qux'
      
      Plus faster `fetch_multi` with stores that implement `write_multi_entries`.
      Keys that aren't found may be written to the cache store in one shot
      instead of separate writes.
      
      The default implementation simply calls `write_entry` for each entry.
      Stores may override if they're capable of one-shot bulk writes, like
      Redis `MSET`.
      2b96d582
  11. 06 6月, 2017 1 次提交
  12. 04 6月, 2017 1 次提交
  13. 03 6月, 2017 2 次提交
  14. 30 5月, 2017 5 次提交
  15. 28 5月, 2017 2 次提交
    • K
      Clear all current instances before a reload. · 85211ea1
      Kasper Timm Hansen 提交于
      If users added an attribute or otherwise changed a CurrentAttributes subclass
      they'd see exceptions on the next page load.
      
      Because `ActiveSupport::CurrentAttributes.current_instances` would keep
      references to the old instances from the previous request.
      
      We can fix this by clearing out the `current_attributes` before we unload
      constants. Then any change to the model can be autoloaded again since its
      slot isn't taken by an old instance.
      
      We'll still have to call reset before we clear so external collaborators,
      like Time.zone, won't linger with their current value throughout other code.
      85211ea1
    • K
      Remove double Thread.current storage. · 3cacbc1e
      Kasper Timm Hansen 提交于
      Since we're generating a key through the class name we can combine
      the two Thread.current calls into a single hash version.
      3cacbc1e
  16. 27 5月, 2017 3 次提交
    • K
      Use non-raising finder. · fcc47bcf
      Kasper Timm Hansen 提交于
      `find` raises when it can't find a record, so we'll never reach the
      else. Switch to `find_by` which returns nil when no record can be
      found.
      fcc47bcf
    • K
      3a131b6c
    • D
      ActiveSupport::CurrentAttributes provides a thread-isolated attributes singleton (#29180) · 24a86443
      David Heinemeier Hansson 提交于
      * Add ActiveSupport::CurrentAttributes to provide a thread-isolated attributes singleton
      
      * Need to require first
      
      * Move stubs into test namespace.
      
      Thus they won't conflict with other Current and Person stubs.
      
      * End of the line for you, whitespace!
      
      * Support super in attribute methods.
      
      Define instance level accessors in an included module such that
      `super` in an overriden accessor works, akin to Active Model.
      
      * Spare users the manual require.
      
      Follow the example of concerns, autoload in the top level Active Support file.
      
      * Add bidelegation support
      
      * Rename #expose to #set. Simpler, clearer
      
      * Automatically reset every instance.
      
      Skips the need for users to actively embed something that resets
      their CurrentAttributes instances.
      
      * Fix test name; add tangible name value when blank.
      
      * Try to ensure we run after a request as well.
      
      * Delegate all missing methods to the instance
      
      This allows regular `delegate` to serve, so we don't need bidelegate.
      
      * Properly test resetting after execution cycle.
      
      Also remove the stale puts debugging.
      
      * Update documentation to match new autoreset
      24a86443
  17. 26 5月, 2017 1 次提交
    • Y
      Remove unused test class · 9b487b93
      yuuji.yaginuma 提交于
      `AlsoDoingNothingTest` was added in cf9be897.
      It seems that it added to confirm that the test works in the child class
      of `ActiveSupport::TestCase`.
      But now basically use `ActiveSupport::TestCase` in test, so I think
      it is unnecessary.
      9b487b93
  18. 25 5月, 2017 2 次提交
  19. 24 5月, 2017 1 次提交
  20. 23 5月, 2017 1 次提交
  21. 20 5月, 2017 2 次提交
    • A
      Fix implicit calculations with scalars and durations · 28938dd6
      Andrew White 提交于
      Previously calculations where the scalar is first would be converted
      to a duration of seconds but this causes issues with dates being
      converted to times, e.g:
      
          Time.zone = "Beijing"           # => Asia/Shanghai
          date = Date.civil(2017, 5, 20)  # => Mon, 20 May 2017
          2 * 1.day                       # => 172800 seconds
          date + 2 * 1.day                # => Mon, 22 May 2017 00:00:00 CST +08:00
      
      Now the `ActiveSupport::Duration::Scalar` calculation methods will try
      to maintain the part structure of the duration where possible, e.g:
      
          Time.zone = "Beijing"           # => Asia/Shanghai
          date = Date.civil(2017, 5, 20)  # => Mon, 20 May 2017
          2 * 1.day                       # => 2 days
          date + 2 * 1.day                # => Mon, 22 May 2017
      
      Fixes #29160, #28970.
      28938dd6
    • D
      Remove unused mismatch payload attribute · dccfcbfd
      David Heinemeier Hansson 提交于
      dccfcbfd
  22. 19 5月, 2017 3 次提交