Skip to content

Commit f6e8eb1

Browse files
authored
Merge pull request #375 from matestack/sf/fix-view-context-method-missing
HasViewContext: Check in advance whether the view context would responnd to a missing method.
2 parents 915daf3 + c203b00 commit f6e8eb1

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)