aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-09-30 03:42:53 -0700
committerJosé Valim <jose.valim@gmail.com>2011-09-30 03:42:53 -0700
commitafeb8976a34a3e3b4568357e08ea564d15d72d2f (patch)
tree1a516d33a844a7fc230c99a45ce136f42f29f868 /activesupport
parentfe157a7475e825ae95fe73450f2c160b36a000e1 (diff)
parentda914fa35c014b7753e609e25c6a45d3cda11274 (diff)
downloadrails-afeb8976a34a3e3b4568357e08ea564d15d72d2f.tar.gz
rails-afeb8976a34a3e3b4568357e08ea564d15d72d2f.tar.bz2
rails-afeb8976a34a3e3b4568357e08ea564d15d72d2f.zip
Merge pull request #3175 from nhocki/as-json-patch
Allow default options for `as_json` method on models
Diffstat (limited to 'activesupport')
-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 14ef27340e..82e232070d 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 = nil)
+ def to_json(options = {})
ActiveSupport::JSON.encode(self, options)
end
RUBY