1. 15 3月, 2017 2 次提交
  2. 08 3月, 2017 1 次提交
  3. 02 3月, 2017 1 次提交
    • A
      Deprecate implicit coercion of `ActiveSupport::Duration` · 75924c45
      Andrew White 提交于
      Currently `ActiveSupport::Duration` implicitly converts to a seconds
      value when used in a calculation except for the explicit examples of
      addition and subtraction where the duration is the receiver, e.g:
      
          >> 2 * 1.day
          => 172800
      
      This results in lots of confusion especially when using durations
      with dates because adding/subtracting a value from a date treats
      integers as a day and not a second, e.g:
      
          >> Date.today
          => Wed, 01 Mar 2017
          >> Date.today + 2 * 1.day
          => Mon, 10 Apr 2490
      
      To fix this we're implementing `coerce` so that we can provide a
      deprecation warning with the intent of removing the implicit coercion
      in Rails 5.2, e.g:
      
          >> 2 * 1.day
          DEPRECATION WARNING: Implicit coercion of ActiveSupport::Duration
          to a Numeric is deprecated and will raise a TypeError in Rails 5.2.
          => 172800
      
      In Rails 5.2 it will raise `TypeError`, e.g:
      
          >> 2 * 1.day
          TypeError: ActiveSupport::Duration can't be coerced into Integer
      
      This is the same behavior as with other types in Ruby, e.g:
      
          >> 2 * "foo"
          TypeError: String can't be coerced into Integer
          >> "foo" * 2
          => "foofoo"
      
      As part of this deprecation add `*` and `/` methods to `AS::Duration`
      so that calculations that keep the duration as the receiver work
      correctly whether the final receiver is a `Date` or `Time`, e.g:
      
          >> Date.today
          => Wed, 01 Mar 2017
          >> Date.today + 1.day * 2
          => Fri, 03 Mar 2017
      
      Fixes #27457.
      75924c45
  4. 24 2月, 2017 1 次提交
  5. 22 2月, 2017 1 次提交
  6. 07 2月, 2017 1 次提交
  7. 04 2月, 2017 1 次提交
  8. 31 1月, 2017 10 次提交
  9. 30 1月, 2017 1 次提交
  10. 29 1月, 2017 1 次提交
  11. 28 1月, 2017 2 次提交
  12. 17 1月, 2017 1 次提交
  13. 15 1月, 2017 2 次提交
  14. 12 1月, 2017 1 次提交
  15. 11 1月, 2017 1 次提交
  16. 06 1月, 2017 1 次提交
  17. 05 1月, 2017 1 次提交
  18. 04 1月, 2017 2 次提交
  19. 03 1月, 2017 1 次提交
    • F
      Fix generator command for nested (namespaced) rails engine · 085546df
      Fumiaki MATSUSHIMA 提交于
      If we create nested (namespaced) rails engine such like bukkits-admin,
      `bin/rails g scaffold User name:string age:integer`
      will create
      `bukkits-admin/app/controllers/bukkits/users_controller.rb`
      but it should create
      `bukkits-admin/app/controllers/bukkits/admin/users_controller.rb`.
      
      In #6643, we changed `namespaced_path` as root path
      because we supposed application_controller is always in root
      but nested rails engine's application_controller will not.
      085546df
  20. 31 12月, 2016 1 次提交
  21. 24 12月, 2016 2 次提交
  22. 23 12月, 2016 1 次提交
  23. 06 12月, 2016 1 次提交
  24. 05 12月, 2016 1 次提交
  25. 01 12月, 2016 1 次提交
  26. 30 11月, 2016 1 次提交