Troubleshooting

When something breaks, can I just raise my hand? Please?
Troubleshooting is a skill unto itself. The ways to troubleshoot problems are not blatantly obvious, especially for a beginner. And they are not taught alongside a curriculum. Like many things, you learn them through experience. As you work alongside other developers, you will gain exposure to the many tactics, methods, and approaches that people use to troubleshoot problems. You will definitely want to remember these!

before_* callbacks rollback transactions if its method returns false

10/05/16  Public, Rails Errors, Troubleshooting

I had a form, where in one of the fields, the user was clicking a drop-down menu, and choosing between one of three choices.

After the form was submitted, I had a callback that was doing something to the record.

When the user selected op...

1 vote - harrylevine

Dealing with a LocalJumpError

06/20/16  Public, Troubleshooting, Ruby General

This is commonly caused by having return called within a block.

Here is an example. This example triggered an Airbrake error of type LocalJumpError:

task :decrement_taken_pto_...

1 vote - harrylevine

Debugging & learning SQL in the rails console

11/19/15  Public, Databases, Troubleshooting, Other Languages

Sometimes examining the SQL generated by ActiveRecord query and finder methods can be useful in debugging and learning SQL. Rails' ActiveRecord provides the to_sql method to make this easy.

Open up the rails console with rails c or `rails c...

2 votes - eliotsykes

Using git bisect to troubleshoot

06/30/15  Public, Troubleshooting

Occasionally, something added to a gem used by one of your projects will break your application. Finding out where, when, and how it broke can be a challenge...

https://mojolingo.com/blog/2013/using-git-bisect-to-troubleshoot-ruby-gems/

1 vote - harrylevine