Regexp to convert from plain scope to proc in RubyMine
From:
, *where(.*)$
To
, -> { where$1 }
NOTE: Review the results. This Regexp does not handle comments on the ends of the scope lines, or additional params.
Running Specs
- Run the rspec with param
-b
to see the full stack trace. You often need this! - Getting very good at the pry debugger is worth the effort.
- Sometimes you need to run the same test on both your Rails 3 and your Rails 4 branch to find where the tests start diverging.
- Often the place where you see the error is long past where the error began. So you have to be a detective and track down the error.