1. 31 10月, 2013 1 次提交
  2. 12 10月, 2013 1 次提交
  3. 11 10月, 2013 1 次提交
  4. 14 9月, 2013 4 次提交
  5. 13 9月, 2013 1 次提交
    • G
      Moved all JSON core extensions into core_ext/object/json · 64c88fb5
      Godfrey Chan 提交于
      TL;DR The primary driver is to remove autoload surprise.
      
      This is related to #12106. (The root cause for that ticket is that
      json/add defines Regexp#to_json among others, but here I'll reproduce
      the problem without json/add.)
      
      Before:
      
         >> require 'active_support/core_ext/to_json'
         => true
         >> //.as_json
         NoMethodError: undefined method `as_json' for //:Regexp
           from (irb):3
           from /Users/godfrey/.rvm/rubies/ruby-2.0.0-p195/bin/irb:16:in `<main>'
         >> //.to_json
         => "\"(?-mix:)\""
         >> //.as_json
         => "(?-mix:)"
      
      After:
      
         >> require 'active_support/core_ext/to_json'
         => true
         >> //.as_json
         => "(?-mix:)"
      
      This is because ActiveSupport::JSON is autoloaded the first time
      Object#to_json is called, which causes additional core extentions
      (previously defined in active_support/json/encoding.rb) to be loaded.
      
      When someone require 'active_support/core_ext', the expectation is
      that it would add certain methods to the core classes NOW. The
      previous behaviour causes additional methods to be loaded the first
      time you call `to_json`, which could cause nasty surprises and other
      unplesant side-effects.
      
      This change moves all core extensions in to core_ext/json. AS::JSON is
      still autoloaded on first #to_json call, but since it nolonger
      include the core extensions, it should address the aforementioned bug.
      
      *Requiring core_ext/object/to_json now causes a deprecation warnning*
      64c88fb5
  6. 07 9月, 2013 1 次提交
  7. 03 9月, 2013 1 次提交
  8. 18 8月, 2013 1 次提交
  9. 15 8月, 2013 2 次提交
  10. 28 7月, 2013 2 次提交
  11. 24 7月, 2013 4 次提交
  12. 14 6月, 2013 1 次提交
  13. 09 6月, 2013 1 次提交
  14. 28 5月, 2013 1 次提交
  15. 12 5月, 2013 1 次提交
  16. 01 5月, 2013 2 次提交
  17. 30 4月, 2013 1 次提交
  18. 14 4月, 2013 1 次提交
  19. 07 4月, 2013 1 次提交
  20. 25 3月, 2013 1 次提交
  21. 14 3月, 2013 1 次提交
  22. 23 2月, 2013 1 次提交
  23. 23 1月, 2013 1 次提交
  24. 06 1月, 2013 1 次提交
  25. 04 1月, 2013 3 次提交
  26. 12 12月, 2012 1 次提交
  27. 11 12月, 2012 1 次提交
  28. 08 12月, 2012 2 次提交