Articles
-
Failing fast when running PostgreSQL scripts
When running scripts against Postgres with the
psql
client, errors will accumulate by default. This is good from the perspective of resiliency, but may not always be desirable behavior, especially with a long-running script. -
How to create deprecation warnings in Rails
Sometimes it is necessary to override inbuilt functionality of Rails (or other dependencies) by creating a monkey patch. However this may only be intended as a temporary solution, waiting on some future fix or upgrade to the framework.
-
Counting lines of code at the command line
Here is a solution for counting lines of code using command line utilities:
-
Testing thrown exceptions with Jest
Here’s a tip for testing asynchronous JavaScript functions that should throw exceptions with Jest.
-
Rerunning a specific ActiveRecord migration in Rails
In production and team environments rerunning prior Rails database migrations is generally not recommended. However there are times when it can be useful, for example when revising a feature branch that has yet to be committed, based on a change to the data model.