aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-04-26 20:25:36 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-04-26 20:26:44 -0700
commit6e3e00219b6910ec39b84844c845e0e237ff15a6 (patch)
tree0155f201af0c2cab2c2e60a0b50715c5f971610d /activerecord/lib/active_record
parent706f31323162ab8bdc5b10180bcd2740c0c9b6c3 (diff)
downloadrails-6e3e00219b6910ec39b84844c845e0e237ff15a6.tar.gz
rails-6e3e00219b6910ec39b84844c845e0e237ff15a6.tar.bz2
rails-6e3e00219b6910ec39b84844c845e0e237ff15a6.zip
Fix differing rails_to_json arity
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/serializers/json_serializer.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/serializers/json_serializer.rb b/activerecord/lib/active_record/serializers/json_serializer.rb
index e9cb8bfca9..48df15d2c0 100644
--- a/activerecord/lib/active_record/serializers/json_serializer.rb
+++ b/activerecord/lib/active_record/serializers/json_serializer.rb
@@ -82,14 +82,17 @@ module ActiveRecord #:nodoc:
end
end
- # For compatibility with ActiveSupport::JSON.encode
- alias rails_to_json to_json
-
def from_json(json)
self.attributes = ActiveSupport::JSON.decode(json)
self
end
+ private
+ # For compatibility with ActiveSupport::JSON.encode
+ def rails_to_json(options, *args)
+ to_json(options)
+ end
+
class JsonSerializer < ActiveRecord::Serialization::Serializer #:nodoc:
def serialize
ActiveSupport::JSON.encode(serializable_record)