1. 24 4月, 2016 6 次提交
  2. 23 4月, 2016 1 次提交
  3. 20 4月, 2016 1 次提交
  4. 19 4月, 2016 3 次提交
    • J
      92d7a4e3
    • J
      Ruby 2.4: compat with new Array#sum · 7ad4690b
      Jeremy Daer 提交于
      Ruby 2.4 introduces `Array#sum`, but it only supports numeric elements,
      breaking our `Enumerable#sum` which supports arbitrary `Object#+`.
      To fix, override `Array#sum` with our compatible implementation.
      
      Native Ruby 2.4:
      
          %w[ a b ].sum
          # => TypeError: String can't be coerced into Fixnum
      
      With `Enumerable#sum` shim:
      
          %w[ a b ].sum
          # => 'ab'
      
      We tried shimming the fast path and falling back to the compatible path
      if it fails, but that ends up slower even in simple causes due to the cost
      of exception handling. Our only choice is to override the native `Array#sum`
      with our `Enumerable#sum`.
      7ad4690b
    • A
      `ActiveSupport::Duration` supports ISO8601 formatting and parsing. · 04c512da
      Arnau Siches, Andrey Novikov 提交于
      ```ruby
      ActiveSupport::Duration.parse('P3Y6M4DT12H30M5S')
      
      (3.years + 3.days).iso8601
      ```
      
      Inspired by Arnau Siches' [ISO8601 gem](https://github.com/arnau/ISO8601/)
      and rewritten by Andrey Novikov with suggestions from Andrew White. Test
      data from the ISO8601 gem redistributed under MIT license.
      
      (Will be used to support the PostgreSQL interval data type.)
      04c512da
  5. 18 4月, 2016 2 次提交
  6. 09 4月, 2016 1 次提交
  7. 04 4月, 2016 2 次提交
    • S
      Match `String#to_time`'s behaviour to ruby · 9c2c677d
      Siim Liiser 提交于
      Previously `String#to_time` returned the midnight of the current date
      in some cases where there was no relavant information in the string.
      Now the method returns `nil` instead in those cases.
      
      Fixes #22958.
      9c2c677d
    • A
      Call super instead of returning nil for DateTime#<=> · 08073125
      Andrew White 提交于
      The native DateTime#<=> implementation can be used to compare instances
      with numeric values being considered as astronomical julian day numbers
      so we should call that instead of returning nil.
      
      Fixes #24228.
      08073125
  8. 02 4月, 2016 1 次提交
    • P
      `number_to_phone` formats number with regexp · 4e977da5
      Pan GaoYong 提交于
      By default, this method formats US number. This commit extends its
      functionality to format number for other countries with a custom regular
      expression.
      
          number_to_phone(18812345678, pattern: /(\d{3})(\d{4})(\d{4})/)
          # => 188-1234-5678
      
      The output phone number is divided into three groups, so the regexp
      should also match three groups of numbers.
      4e977da5
  9. 01 4月, 2016 1 次提交
  10. 25 3月, 2016 1 次提交
  11. 22 3月, 2016 1 次提交
  12. 11 3月, 2016 1 次提交
    • O
      Prevent `Marshal.load` from looping infinitely · aa0fad51
      Olek Janiszewski 提交于
      Fix a bug in `Marshal.load` that caused it to loop indefinitely when
      trying to autoload a constant that resolved to a different name.
      
      This could occur when marshalling an ActiveRecord 4.0 object (e.g. into
      memcached) and then trying to unmarshal it with Rails 4.2. The
      marshalled payload contains a reference to
      `ActiveRecord::ConnectionAdapters::Mysql2Adapter::Column`, which in
      Rails 4.2 resolves to
      `ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::Column`.
      aa0fad51
  13. 03 3月, 2016 1 次提交
  14. 01 3月, 2016 2 次提交
  15. 26 2月, 2016 1 次提交
  16. 25 2月, 2016 1 次提交
  17. 23 2月, 2016 1 次提交
  18. 21 2月, 2016 1 次提交
  19. 15 2月, 2016 1 次提交
  20. 11 2月, 2016 1 次提交
  21. 02 2月, 2016 4 次提交
  22. 29 1月, 2016 1 次提交
  23. 13 1月, 2016 1 次提交
  24. 08 1月, 2016 1 次提交
  25. 03 1月, 2016 1 次提交
  26. 02 1月, 2016 1 次提交
  27. 31 12月, 2015 1 次提交