ruby on rails - Assigning an exception to a variable in pry -
So I'm trying to use pry to debug a method_missing in my Rail app : This is my code You always use the last exception through the global variable Can [5] pry (# & lt; Travel Agreement & gt;) & gt; E-name: Undefined local variables or # & lt; Method 'E' for Travel: Travel: 0x007fa3f30d13c8 & gt;
21: define_method (save_method) Do 22: If "@ # {method_name}" exists? 23: Start 24: self.send ("# {attribute} =", time .pars (instance_variable_get ("@ # {method_name}"))) 25: rescue = & gt; E = & gt; 26: binding.pry
$! . See if your breakpoint works. It's possible that you have a breakpoint set elsewhere, and are actually debugging the wrong line.
Comments
Post a Comment