- 13 9月, 2013 2 次提交
-
-
由 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*
-
由 Godfrey Chan 提交于
It turns out that ActionPack depends on the decoder to parse JSON "fragments" (e.g. '"a string"', '1', 'null', etc), so we need to enable quirks mode on JSON.parse. Also added coverage on the decoder side to prevent regression.
-
- 12 9月, 2013 1 次提交
-
-
由 Godfrey Chan 提交于
Since we are dealing with untrusted user input, we should not be using JSON.load. According to the docs[1]: BEWARE: This method is meant to serialise data from trusted user input, like from your own database server or clients under your control, it could be dangerous to allow untrusted users to pass JSON sources into it. The default options for the parser can be changed via the ::load_default_options method. [1] http://www.ruby-doc.org/stdlib-2.0/libdoc/json/rdoc/JSON.html#method-i-load
-
- 07 8月, 2013 1 次提交
-
-
由 Gaurish Sharma 提交于
This change is similar to #11736 & in same way switched with fixed string & the index of the hash for method name. the index was added because otherwise, ruby will raise Error.
-
- 01 6月, 2013 1 次提交
-
-
由 kennyj 提交于
-
- 26 5月, 2013 1 次提交
-
-
由 Vipul A M 提交于
-
- 12 5月, 2013 1 次提交
-
-
由 Erik Michaels-Ober 提交于
-
- 09 5月, 2013 1 次提交
-
-
由 Mario Caropreso 提交于
U+2028 and U+2029 are allowed inside strings in JSON (as all literal Unicode characters) but JavaScript defines them as newline seperators. Because no literal newlines are allowed in a string, this causes a ParseError in the browser. We work around this issue by replacing them with the escaped version. The resulting JSON is still valid and can be parsed in the browser. This commit has been coauthored with Viktor Kelemen @yikulju
-
- 04 5月, 2013 1 次提交
-
-
由 Ryan Davis 提交于
-
- 28 12月, 2012 1 次提交
-
-
由 Yves Senn 提交于
As reported (https://github.com/rails/rails/pull/8185#issuecomment-11702226) this test relied on the order a hash was serialized. Comparing the parsed hash makes the test no longer order dependent.
-
- 15 12月, 2012 1 次提交
-
-
由 Brett Carter 提交于
The encoding scheme (e.g.
☠ -> "\u2620") was broken for characters not in the Basic Multilingual Plane. It is possible to escape them for json using the weird encoding scheme of a twelve-character sequence representing the UTF-16 surrogate pair (e.g. '𠜎' -> "\u270e\u263a") but this wasn't properly handled in the escaping code. Since raw UTF-8 is allowed in json, it was decided to simply pass through the raw bytes rather than attempt to escape them.
-
- 12 11月, 2012 1 次提交
-
-
由 Yves Senn 提交于
Setting options in a custom `#as_json` method had side effects. Modifications of the `options` hash leaked outside and influenced the conversion of other objects contained in the hash.
-
- 08 8月, 2012 1 次提交
-
-
由 Erich Menge 提交于
Reason: ActiveSupport::JSON::Variable is not used anymore internally. It was deprecated in 3-2-stable but we reverted all the deprecation for point releases. See #6536 and #6546. Conflicts: activesupport/lib/active_support/json/variable.rb
-
- 31 5月, 2012 1 次提交
-
-
由 Erich Menge 提交于
-
- 30 5月, 2012 1 次提交
-
-
由 Erich Menge 提交于
-
- 02 5月, 2012 1 次提交
-
-
由 David FRANCOIS 提交于
-
- 01 5月, 2012 1 次提交
-
-
由 Sebi Burkhard 提交于
-
- 06 1月, 2012 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 02 1月, 2012 1 次提交
-
-
由 Sergey Nartimov 提交于
-
- 25 12月, 2011 1 次提交
-
-
由 Sergey Nartimov 提交于
-
- 21 12月, 2011 1 次提交
-
-
由 José Valim 提交于
There are a bunch of other implicit branches that adds 1.8.x specific code that still needs to be removed. Pull requests for those cases are welcome.
-
- 15 8月, 2011 1 次提交
-
-
由 Sebi Burkhard 提交于
-
- 14 8月, 2011 1 次提交
-
-
由 Arun Agrawal 提交于
-
- 01 8月, 2011 1 次提交
-
-
由 Arun Agrawal 提交于
-
- 23 7月, 2011 1 次提交
-
-
由 Xavier Noria 提交于
Came with this one-liner for this: find . -name '*.rb' | \ xargs chardet | \ grep -v ascii | \ cut -d: -f1 -s | \ xargs -n1 ruby -0777 -ne 'puts $FILENAME if $_ !~ /#.*coding:\s*utf/i' Welcome $_.
-
- 19 4月, 2011 2 次提交
-
-
由 Josh Kalderimis 提交于
AS Json parse_error makes a return for backwards compatibility, although it will return MultiJson::DecodeError
-
由 Josh Kalderimis 提交于
-
- 02 4月, 2011 1 次提交
-
-
由 John Firebaugh 提交于
-
- 23 3月, 2011 2 次提交
-
-
由 Diego Carrion 提交于
Signed-off-by: NSantiago Pastorino <santiago@wyeworks.com>
-
由 Diego Carrion 提交于
test json decoding with time parsing disabled with all backends and respect ActiveSupport.parse_json_times when converting to yaml Signed-off-by: NSantiago Pastorino <santiago@wyeworks.com>
-
- 12 2月, 2011 1 次提交
-
-
由 Josh Kalderimis 提交于
Updated the json date regex to recognize xmlschema formatted date times during json decoding. [#3031 state:resolved] Signed-off-by: NSantiago Pastorino and Emilio Tagua <santiago+emilioe@wyeworks.com>
-
- 11 2月, 2011 1 次提交
-
-
由 Josh Kalderimis 提交于
Fixes an issue when decoding a json string which looks like a date but is invalid. This DateTime parse error is now caught and the original string is instead passed back [#6286 state:resolved] Signed-off-by: NSantiago Pastorino <santiago@wyeworks.com>
-
- 03 2月, 2011 2 次提交
-
-
由 Santiago Pastorino 提交于
-
由 Maxime RETY 提交于
Signed-off-by: NSantiago Pastorino <santiago@wyeworks.com>
-
- 22 1月, 2011 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 18 1月, 2011 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 15 1月, 2011 1 次提交
-
-
由 Alexey Nayden 提交于
Signed-off-by: NSantiago Pastorino <santiago@wyeworks.com>
-
- 12 1月, 2011 1 次提交
-
-
由 Josh Kalderimis 提交于
Signed-off-by: NSantiago Pastorino <santiago@wyeworks.com>
-
- 08 9月, 2010 1 次提交
-
-
由 Jakub Suder 提交于
- as_json in ActiveModel should return a hash and handle :only/:except/:methods options - Array and Hash should call as_json on their elements - json methods should not modify options argument [#5374 state:committed] Signed-off-by: NJeremy Kemper <jeremy@bitsweat.net>
-
- 24 7月, 2010 1 次提交
-
-
由 Santiago Pastorino 提交于
Signed-off-by: NJosé Valim <jose.valim@gmail.com>
-