Permalink
Browse files

Only undef to_json if it's defined

  • Loading branch information...
1 parent acb1624 commit 418ce487c4a41df2c3a3c1485107f32eb94fa493 @jeremy jeremy committed Oct 20, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/metal/responder.rb
@@ -95,7 +95,7 @@ def initialize(controller, resources, options={})
delegate :get?, :post?, :put?, :delete?, :to => :request
# Undefine :to_json since it's defined on Object
- undef_method :to_json
+ undef_method(:to_json) if method_defined?(:to_json)
# Initializes a new responder an invoke the proper format. If the format is
# not defined, call to_format.

0 comments on commit 418ce48

Please sign in to comment.