Permalink
Browse files

1.8.7 fix

  • Loading branch information...
1 parent ff66f80 commit 7bfdf8501124b3b9f4256a151d24a1e9dee934db @Ortuna Ortuna committed Feb 12, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/sinatra/json.rb
View
@@ -109,17 +109,17 @@ def resolve_encoder(options = {})
options[:json_encoder] || settings.json_encoder
end
- def resolve_encoder_action(object = {}, encoder)
+ def resolve_encoder_action(object, encoder)
[:encode, :generate].each do |method|
return encoder.send(method, object) if encoder.respond_to? method
end
if encoder.is_a? Symbol
object.__send__(encoder)
else
fail "#{encoder} does not respond to #generate nor #encode"
- end
- end
- end
+ end #if
+ end #resolve_encoder_action
+ end #JSON
Base.set :json_encoder do
::MultiJson

0 comments on commit 7bfdf85

Please sign in to comment.