summaryrefslogtreecommitdiff
path: root/ext/json/lib/json/add/rails.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-26 00:06:35 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-26 00:06:35 +0000
commit54592ad6276a17d95f2186c8631197ddb172020b (patch)
treefd071c795bc3e589237d89dd593f93d7b0376a4f /ext/json/lib/json/add/rails.rb
parent9372cdb80a376f352fc55ea895f1ad688cf4a0df (diff)
* ext/json: Update to JSON 1.4.1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/json/lib/json/add/rails.rb')
-rw-r--r--ext/json/lib/json/add/rails.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/json/lib/json/add/rails.rb b/ext/json/lib/json/add/rails.rb
index e86ed1aab9..8ce85efe57 100644
--- a/ext/json/lib/json/add/rails.rb
+++ b/ext/json/lib/json/add/rails.rb
@@ -10,7 +10,7 @@ class Object
def self.json_create(object)
obj = new
for key, value in object
- next if key == 'json_class'
+ next if key == JSON.create_id
instance_variable_set "@#{key}", value
end
obj
@@ -18,7 +18,7 @@ class Object
def to_json(*a)
result = {
- 'json_class' => self.class.name
+ JSON.create_id => self.class.name
}
instance_variables.inject(result) do |r, name|
r[name[1..-1]] = instance_variable_get name