Skip to content

Commit c203b00

Browse files
committed
HasViewContext: Check in advance whether the view context would respond to a missing method.
1 parent 915daf3 commit c203b00

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/lib/matestack/ui/core/has_view_context.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ def initialize(model = nil, options = {})
55
end
66

77
def method_missing(*args, &block)
8-
@view_context.send(*args, &block)
8+
if @view_context.respond_to? args.first
9+
@view_context.send(*args, &block)
10+
else
11+
super
12+
end
913
end
1014
end

0 commit comments

Comments
 (0)