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 06:27:27 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-26 06:27:27 +0000
commit3642494ce5a44938285677669b3e001a1af1ce47 (patch)
tree73fae9b5eb43a636cf3b928ef1630a9d831a613f /ext/json/lib/json/add/rails.rb
parent27be3056dc0e9c313f25b430ca90b240a5e44160 (diff)
Recommit of JSON; fix mixed declarations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27501 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