1. 28 9月, 2018 2 次提交
  2. 11 9月, 2018 1 次提交
  3. 08 9月, 2018 1 次提交
  4. 07 9月, 2018 2 次提交
  5. 15 8月, 2018 1 次提交
    • B
      Add `Array#extract!` · 77b01260
      bogdanvlviv 提交于
      The method removes and returns the elements for which the block returns a true value.
      If no block is given, an Enumerator is returned instead.
      
      ```
      numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
      odd_numbers = numbers.extract! { |number| number.odd? } # => [1, 3, 5, 7, 9]
      numbers # => [0, 2, 4, 6, 8]
      ```
      77b01260
  6. 10 8月, 2018 1 次提交
  7. 06 8月, 2018 1 次提交
  8. 05 8月, 2018 1 次提交
    • M
      Support skip nil for cache fetch (#25437) · 47018a82
      Martin 提交于
      * test case for fetch cache miss with skip_nil
      
      * abondon nil cache if skip_nil specified
      
      * ensure not cache key for skip nil
      
      * add document with skip_nil for Store#fetch
      
      * add a new change log entry for #25437
      47018a82
  9. 27 7月, 2018 3 次提交
  10. 01 7月, 2018 1 次提交
    • K
      Refactor #33254. · 969577d9
      Kasper Timm Hansen 提交于
      Firstly, increment and decrement shouldn't care about the particulars of
      key expiry. They should only know that they have to pass that responsibility
      on to somewhere else.
      
      Secondly, it moves the key normalization back inside the instrumentation like
      it was originally. I think that matches the original design intention or at
      the very least it lets users catch haywire key truncation.
      
      Thirdly, it moves the changelog entry to the top of the file, where new entries
      go. I couldn't understand what the entry was saying so I tried to rewrite it.
      969577d9
  11. 29 6月, 2018 1 次提交
  12. 31 5月, 2018 1 次提交
  13. 22 5月, 2018 1 次提交
  14. 21 5月, 2018 1 次提交
  15. 22 4月, 2018 1 次提交
  16. 19 4月, 2018 2 次提交
    • G
      Redis cache store: avoid blocking the server in `#delete_matched` · ef2af628
      Gleb Mazovetskiy 提交于
      Fixes #32610. Closes #32614.
      
      Lua scripts in redis are *blocking*, meaning that no other client can
      execute any commands while the script is running. See
      https://redis.io/commands/eval#atomicity-of-scripts.
      
      This results in the following exceptions once the number of keys is
      sufficiently large:
      
          BUSY Redis is busy running a script.
          You can only call SCRIPT KILL or SHUTDOWN NOSAVE.
      
      This commit replaces the lua-based implementation with one that uses
      `SCAN` and `DEL` in batches. This doesn't block the server.
      
      The primary limitation of `SCAN`, i.e. potential duplicate keys, is of
      no consequence here, because `DEL` ignores keys that do not exist.
      ef2af628
    • D
      Fix exception in AS::Timezone.all when any tzinfo data is missing · 7d25b651
      Dominik Sander 提交于
      Before this change missing timezone data for any of the time zones
      defined in `ActiveSupport::Timezone::MAPPING` caused a `comparison of
      NilClass with ActiveSupport::TimeZone failed` exception.
      
      Attempting to get a timezone by passing a number/duration to `[]` or
      calling `all` directly will try to sort sort the values of `zones_map`.
      Those values are initialized by the return value of `create(zonename)`
      which returns `nil` if `TZInfo` is unable to find the timezone
      information.
      
      In our case the exception was triggered by an outdated tzdata package
      which did not include information for the "recently" added time zones.
      
      Before 078421ba `zones_map` only
      returned the information that have been loaded into `@lazy_zone_map`
      which ignored time zones for which the data could not be loaded, this
      change restores the previous behaviour.
      7d25b651
  17. 12 4月, 2018 1 次提交
  18. 14 3月, 2018 1 次提交
  19. 12 3月, 2018 1 次提交
    • B
      Fix CHANGELOGs [ci skip] · dd075657
      bogdanvlviv 提交于
      - Add missing dots.
      - Remove reference to itself on GitHub.
        Usually, we add references to fixed issues only in a changelog.
      
      Follow up #32223
      dd075657
  20. 07 3月, 2018 2 次提交
    • N
      Add `before?` and `after?` methods to date and time classes · 20fa0d92
      Nick Holden 提交于
      Equality comparisons between dates and times can take some extra time to
      comprehend. I tend to think of a date or time as "before" or "after"
      another date or time, but I naturally read `<` and `>` as "less than"
      and "greater than." This change seeks to make date/time comparisons more
      human readable.
      20fa0d92
    • A
      URI.unescape handles mixed Unicode/escaped input · e52ab312
      Ashe Connor 提交于
      Previously, URI.enscape could handle Unicode input (without any actual
      escaped characters), or input with escaped characters (but no actual
      Unicode characters) - not both.
      
          URI.unescape("\xe3\x83\x90")  # => "バ"
          URI.unescape("%E3%83%90")  # => "バ"
          URI.unescape("\xe3\x83\x90%E3%83%90")  # =>
                                               # Encoding::CompatibilityError
      
      We need to let `gsub` handle this for us, and then force back to the
      original encoding of the input.  The result String will be mangled if
      the percent-encoded characters don't conform to the encoding of the
      String itself, but that goes without saying.
      Signed-off-by: NAshe Connor <ashe@kivikakk.ee>
      e52ab312
  21. 05 3月, 2018 1 次提交
  22. 28 2月, 2018 1 次提交
  23. 27 2月, 2018 2 次提交
  24. 26 2月, 2018 1 次提交
  25. 24 2月, 2018 1 次提交
  26. 19 2月, 2018 1 次提交
    • A
      Return all mappings for a timezone id in `country_zones` · 2d95956e
      Andrew White 提交于
      Some timezones like `Europe/London` have multiple mappings in
      `ActiveSupport::TimeZone::MAPPING` so return all of them instead
      of the first one found by using `Hash#value`. e.g:
      
        # Before
        ActiveSupport::TimeZone.country_zones("GB") # => ["Edinburgh"]
      
        # After
        ActiveSupport::TimeZone.country_zones("GB") # => ["Edinburgh", "London"]
      
      Fixes #31668.
      2d95956e
  27. 18 2月, 2018 3 次提交
  28. 16 2月, 2018 1 次提交
    • E
      Add test parallelization to Rails · 26821d9b
      eileencodes 提交于
      Provides both a forked process and threaded parallelization options. To
      use add `parallelize` to your test suite.
      
      Takes a `workers` argument that controls how many times the process
      is forked. For each process a new database will be created suffixed
      with the worker number; test-database-0 and test-database-1
      respectively.
      
      If `ENV["PARALLEL_WORKERS"]` is set the workers argument will be ignored
      and the environment variable will be used instead. This is useful for CI
      environments, or other environments where you may need more workers than
      you do for local testing.
      
      If the number of workers is set to `1` or fewer, the tests will not be
      parallelized.
      
      The default parallelization method is to fork processes. If you'd like to
      use threads instead you can pass `with: :threads` to the `parallelize`
      method. Note the threaded parallelization does not create multiple
      database and will not work with system tests at this time.
      
      parallelize(workers: 2, with: :threads)
      
      The threaded parallelization uses Minitest's parallel exector directly.
      The processes paralleliztion uses a Ruby Drb server.
      
      For parallelization via threads a setup hook and cleanup hook are
      provided.
      
      ```
      class ActiveSupport::TestCase
        parallelize_setup do |worker|
          # setup databases
        end
      
        parallelize_teardown do |worker|
          # cleanup database
        end
      
        parallelize(workers: 2)
      end
      ```
      
      [Eileen M. Uchitelle, Aaron Patterson]
      26821d9b
  29. 02 2月, 2018 1 次提交
  30. 31 1月, 2018 1 次提交
  31. 23 1月, 2018 1 次提交