Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch '2-3-stable' of git@github.com:rails/rails into 2-3-stable

  • Loading branch information...
commit 4b331554288aaafb35a4cc511810c3b61cf2c2b5 2 parents 8dab61d + 55501b9
Jeremy Kemper jeremy authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 activerecord/lib/active_record/serializers/json_serializer.rb
8 activerecord/lib/active_record/serializers/json_serializer.rb
View
@@ -74,13 +74,15 @@ def self.included(base)
# {"comments": [{"body": "Don't think too hard"}],
# "title": "So I was thinking"}]}
def to_json(options = {})
+ super
+ end
+
+ def as_json(options = nil) #:nodoc:
hash = Serializer.new(self, options).serializable_record
hash = { self.class.model_name.element => hash } if include_root_in_json
- ActiveSupport::JSON.encode(hash)
+ hash
end
- def as_json(options = nil) self end #:nodoc:
-
def from_json(json)
self.attributes = ActiveSupport::JSON.decode(json)
self
Please sign in to comment.
Something went wrong with that request. Please try again.