Browse files

Don't unnecessarily use String eval.

  • Loading branch information...
wycats committed Sep 27, 2011
1 parent e407dfb commit 598fc578fbd38907288e14053bfc6eb8d4da1e3b
Showing with 2 additions and 2 deletions.
  1. +2 −2 activesupport/lib/active_support/core_ext/object/to_json.rb
@@ -10,10 +10,10 @@
# several cases (for instance, the JSON implementation for Hash does not work) with inheritance
# and consequently classes as ActiveSupport::OrderedHash cannot be serialized to json.
[Object, Array, FalseClass, Float, Hash, Integer, NilClass, String, TrueClass].each do |klass|
- klass.class_eval <<-RUBY, __FILE__, __LINE__
+ klass.class_eval do
# Dumps object in JSON (JavaScript Object Notation). See for more info.
def to_json(options = nil)
ActiveSupport::JSON.encode(self, options)
+ end

0 comments on commit 598fc57

Please sign in to comment.