From a318e946a770d774d40f7a1f713ab6b4c1b5b036 Mon Sep 17 00:00:00 2001 From: Frederik Deweerdt Date: Wed, 16 May 2012 15:22:39 -0700 Subject: [PATCH] ticket.method_missing fix the '!' case When calling instance_eval we need to pass in the stripped method name (without the '!'), otherwise a call to ticket.my_field! fails with: /var/lib/gems/1.8/gems/trac4r-1.2.3/lib/trac4r/ticket.rb:51:in `method_missing': (eval):1:in `method_missing': compile error (SyntaxError) (eval):1: syntax error, unexpected '!', expecting $end @ticketclones! --- lib/trac4r/ticket.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/trac4r/ticket.rb b/lib/trac4r/ticket.rb index 77e2fc1..57aa428 100644 --- a/lib/trac4r/ticket.rb +++ b/lib/trac4r/ticket.rb @@ -44,7 +44,7 @@ def method_missing(sym,*args) method = sym.to_s method = method[0..-2] if method =~ /!$/ if args.size == 0 && instance_variables.include?("@#{method}".to_sym) - instance_eval("@" + sym.to_s) + instance_eval("@" + method) elsif method != sym.to_s nil else