aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object/to_json.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-09-30 12:45:36 +0200
committerJosé Valim <jose.valim@gmail.com>2011-09-30 12:45:36 +0200
commit37b9594a8e08916e1e9ae9a6aaffc13ef516ad11 (patch)
treef62709f7669d7fe783eb13f7045cf88cd8dd64f5 /activesupport/lib/active_support/core_ext/object/to_json.rb
parentafeb8976a34a3e3b4568357e08ea564d15d72d2f (diff)
downloadrails-37b9594a8e08916e1e9ae9a6aaffc13ef516ad11.tar.gz
rails-37b9594a8e08916e1e9ae9a6aaffc13ef516ad11.tar.bz2
rails-37b9594a8e08916e1e9ae9a6aaffc13ef516ad11.zip
Set the default options value for as_json in the encoder object.
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object/to_json.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/object/to_json.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/to_json.rb b/activesupport/lib/active_support/core_ext/object/to_json.rb
index 82e232070d..14ef27340e 100644
--- a/activesupport/lib/active_support/core_ext/object/to_json.rb
+++ b/activesupport/lib/active_support/core_ext/object/to_json.rb
@@ -12,7 +12,7 @@ end
[Object, Array, FalseClass, Float, Hash, Integer, NilClass, String, TrueClass].each do |klass|
klass.class_eval <<-RUBY, __FILE__, __LINE__
# Dumps object in JSON (JavaScript Object Notation). See www.json.org for more info.
- def to_json(options = {})
+ def to_json(options = nil)
ActiveSupport::JSON.encode(self, options)
end
RUBY