1. 05 3月, 2013 1 次提交
  2. 29 1月, 2013 1 次提交
  3. 23 1月, 2013 1 次提交
  4. 21 1月, 2013 2 次提交
    • A
      Use `DateTime.parse` inside `String#to_datetime` · ee345821
      Andrew White 提交于
      Use the standard library's `DateTime.parse` because it's marginally
      faster and supports partial date/time strings.
      
      Benchmark:
             user     system      total        real
      old  3.980000   0.000000   3.980000 (  3.987606)
      new  3.640000   0.010000   3.650000 (  3.641342)
      ee345821
    • A
      Standardise the return value of `to_time` · b79adc43
      Andrew White 提交于
      This commit standardises the return value of `to_time` to an instance
      of `Time` in the local system timezone, matching the Ruby core and
      standard library behavior.
      
      The default form for `String#to_time` has been changed from :utc to
      :local but research seems to suggest the latter is the more common form.
      
      Also fix an edge condition with `String#to_time` where the string has
      a timezone offset in it and the mode is :local. e.g:
      
        # Before:
        >> "2000-01-01 00:00:00 -0500".to_time(:local)
        => 2000-01-01 05:00:00 -0500
      
        # After:
        >> "2000-01-01 00:00:00 -0500".to_time(:local)
        => 2000-01-01 00:00:00 -0500
      
      Closes #2453
      b79adc43
  5. 05 1月, 2013 1 次提交
  6. 20 12月, 2012 1 次提交
  7. 11 12月, 2012 2 次提交
    • A
      Deprecate obsolete Time to DateTime fallback methods · 48583f8b
      Andrew White 提交于
      The Time.time_with_datetime_fallback, Time.utc_time and Time.local_time
      methods were added to handle the limitations of Ruby's native Time
      implementation. Those limitations no longer apply so we are deprecating
      them in 4.0 and they will be removed in 4.1.
      48583f8b
    • A
      Add String#in_time_zone method · 331a82a1
      Andrew White 提交于
      This commit adds a convenience method for converting a string to an
      ActiveSupport::TimeWithZone instance using the configured Time.zone or
      another passed as an argument.
      331a82a1
  8. 29 11月, 2012 2 次提交
  9. 30 10月, 2012 1 次提交
  10. 24 10月, 2012 1 次提交
  11. 24 9月, 2012 1 次提交
  12. 13 9月, 2012 1 次提交
  13. 09 9月, 2012 1 次提交
  14. 07 8月, 2012 1 次提交
  15. 01 8月, 2012 1 次提交
  16. 31 7月, 2012 1 次提交
    • D
      Make ActiveSupport::Inflector locale aware and multilingual · 7db0b073
      David Celis 提交于
      The Inflector is currently not very supportive of internationalized
      websites. If a user wants to singularize and/or pluralize words based on
      any locale other than English, they must define each case in locale
      files. Rather than create large locale files with mappings between
      singular and plural words, why not allow the Inflector to accept a
      locale?
      
      This patch makes ActiveSupport::Inflector locale aware and uses `:en`` unless
      otherwise specified. Users will still be provided a list of English (:en)
      inflections, but they may additionally define inflection rules for other
      locales. Each list is kept separately and permanently. There is no reason to
      limit users to one list of inflections:
      
          ActiveSupport::Inflector.inflections(:es) do |inflect|
            inflect.plural(/$/, 's')
            inflect.plural(/([^aeéiou])$/i, '\1es')
            inflect.plural(/([aeiou]s)$/i, '\1')
            inflect.plural(/z$/i, 'ces')
            inflect.plural(/á([sn])$/i, 'a\1es')
            inflect.plural(/é([sn])$/i, 'e\1es')
            inflect.plural(/í([sn])$/i, 'i\1es')
            inflect.plural(/ó([sn])$/i, 'o\1es')
            inflect.plural(/ú([sn])$/i, 'u\1es')
      
            inflect.singular(/s$/, '')
            inflect.singular(/es$/, '')
      
            inflect.irregular('el', 'los')
          end
      
          'ley'.pluralize(:es)   # => "leyes"
          'ley'.pluralize(:en)   # => "leys"
          'avión'.pluralize(:es) # => "aviones"
          'avión'.pluralize(:en) # => "avións"
      
      A multilingual Inflector should be of use to anybody that is tasked with
      internationalizing their Rails application.
      Signed-off-by: NDavid Celis <david@davidcelis.com>
      7db0b073
  17. 16 6月, 2012 1 次提交
  18. 29 5月, 2012 1 次提交
  19. 27 5月, 2012 1 次提交
  20. 24 5月, 2012 1 次提交
    • V
      Revert "Remove blank trailing comments" · 1ad0b378
      Vijay Dev 提交于
      This reverts commit fa6d921e.
      
      Reason: Not a fan of such massive changes. We usually close such changes
      if made to Rails master as a pull request. Following the same principle
      here and reverting.
      
      [ci skip]
      1ad0b378
  21. 20 5月, 2012 1 次提交
    • H
      Remove blank trailing comments · fa6d921e
      Henrik Hodne 提交于
      For future reference, this is the regex I used: ^\s*#\s*\n(?!\s*#). Replace
      with the first match, and voilà! Note that the regex matches a little bit too
      much, so you probably want to `git add -i .` and go through every single diff
      to check if it actually should be changed.
      fa6d921e
  22. 18 5月, 2012 1 次提交
  23. 17 5月, 2012 3 次提交
  24. 16 5月, 2012 1 次提交
  25. 14 5月, 2012 1 次提交
  26. 12 5月, 2012 10 次提交