diff options
author | Jose and Yehuda <wycats@gmail.com> | 2011-09-27 17:35:11 -0400 |
---|---|---|
committer | Jose and Yehuda <wycats@gmail.com> | 2011-10-15 18:40:37 +0200 |
commit | 598fc578fbd38907288e14053bfc6eb8d4da1e3b (patch) | |
tree | f03ce64fc70402e679c1bf672db2053c90976ef0 /activesupport | |
parent | e407dfb9bf6ee3b12d699511ef05e6f260c5edf1 (diff) | |
download | rails-598fc578fbd38907288e14053bfc6eb8d4da1e3b.tar.gz rails-598fc578fbd38907288e14053bfc6eb8d4da1e3b.tar.bz2 rails-598fc578fbd38907288e14053bfc6eb8d4da1e3b.zip |
Don't unnecessarily use String eval.
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/to_json.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/to_json.rb b/activesupport/lib/active_support/core_ext/object/to_json.rb index 14ef27340e..e7dc60a612 100644 --- a/activesupport/lib/active_support/core_ext/object/to_json.rb +++ b/activesupport/lib/active_support/core_ext/object/to_json.rb @@ -10,10 +10,10 @@ end # 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 www.json.org for more info. def to_json(options = nil) ActiveSupport::JSON.encode(self, options) end - RUBY + end end |