1. 10 1月, 2017 3 次提交
    • A
      Fix inconsistent results when parsing large durations and constructing durations from code · cb9d0e48
      Andrey Novikov 提交于
          ActiveSupport::Duration.parse('P3Y') == 3.years # It should be true
      
      Duration parsing made independent from any moment of time:
      Fixed length in seconds is assigned to each duration part during parsing.
      
      Changed duration of months and years in seconds to more accurate and logical:
      
       1. The value of 365.2425 days in Gregorian year is more accurate
          as it accounts for every 400th non-leap year.
      
       2. Month's length is bound to year's duration, which makes
          sensible comparisons like `12.months == 1.year` to be `true`
          and nonsensical ones like `30.days == 1.month` to be `false`.
      
      Calculations on times and dates with durations shouldn't be affected as
      duration's numeric value isn't used in calculations, only parts are used.
      
      Methods on `Numeric` like `2.days` now use these predefined durations
      to avoid duplicating of duration constants through the codebase and
      eliminate creation of intermediate durations.
      cb9d0e48
    • K
      Merge pull request #27551 from kirs/deprecate-class-name-as-class · 3bc747bd
      Kasper Timm Hansen 提交于
      Deprecate reflection class name to accept a class
      3bc747bd
    • K
      Deprecate reflection class name to accept a class · 8312a0d2
      Kir Shatrov 提交于
      The idea of `class_name` as an option of reflection is that passing a
      string would allow us to lazy autoload the class.
      
      Using `belongs_to :client, class_name: Customer` is eagerloading models more than necessary
      and creating possible circular dependencies.
      8312a0d2
  2. 09 1月, 2017 3 次提交
  3. 08 1月, 2017 3 次提交
  4. 07 1月, 2017 8 次提交
  5. 06 1月, 2017 8 次提交
  6. 05 1月, 2017 15 次提交