Permalink
Browse files

Augments with respond_to block delegating to scope

  • Loading branch information...
1 parent 34110c5 commit 85473f4916efe398d71cb9e15a160ad93523f07d @nesquena nesquena committed May 19, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/rabl/engine.rb
View
@@ -149,6 +149,11 @@ def format_json(json_output)
use_callback ? "#{request_params[:callback]}(#{json_output})" : json_output
end
+ # Augments respond to supporting scope methods
+ def respond_to?(name, include_private=false)
+ @_scope.respond_to?(name, include_private) ? true : super
+ end
+
# Supports calling helpers defined for the template scope using method_missing hook
def method_missing(name, *args, &block)
@_scope.respond_to?(name) ? @_scope.send(name, *args, &block) : super

0 comments on commit 85473f4

Please sign in to comment.