Hello ππ»
I'm Michael.
product-minded software consultant
Recent Articles
Getting to know your Rails dbconsole (PostgreSQL)
π₯οΈDev
Let's go over a few commands that are helpful when poking around in the Postgres console
databasespostgreSqlrails
Goodbye webpack?
π₯οΈDev
A few backend frameworks are looking to replace webpack with something less heavy-handed, Rails included.
elixirjavaScriptphoenixrailsruby
Adding counter caches to existing models in Rails
π₯οΈDev
Counting the amount of records that exist is a very common task for your database. Rails has a built-in mechanism for caching this value to reduce the number of round trips.
databasespostgreSqlrailsruby
Ensuring a column is unique for an entity in Rails
π₯οΈDev
Sometimes you want to validate that a column is a unique for a given relationship and not across the entire table.
databasespostgreSqlrails
How to use acronyms in the classes of your Rails application
π₯οΈDev
Acronyms are strange to implement in Ruby, but are easy to manage in Rails when leveraging ActiveSupport.
railsruby
Using namespaces to organize your Rails code base
π₯οΈDev
Sometimes you want to namespace areas of your application to group related code together, and Rails has support for this baked in.
architecturerailsruby
Grabbing the last result in common Rails debuggers
π₯οΈDev
Sometimes you want to access the value returned by the last command you wrote into a Ruby REPL. Thereβs a trick for that.
ruby
Using i18n to customize submit button text in Rails
π₯οΈDev
The Rails submit form helper populates the button's text by using a humanized/readable version of the model's class name. Sometimes that isn't idea, but i18n has our backs.
i18nrails
Why I no longer define ActiveRecord scopes with class methods
π₯οΈDev
ActiveRecord scopes can be defined using the scope method or class methods on your model using the self keyword, but there is an important difference between the two.
rails
Using dbconsole to index and test Rails query performance on the fly
π₯οΈDev
Rails ships with a command for loading up the REPL for your database that can be useful for testing out the effectiveness of adding indexes to lower query response times.
databasesperformancepostgreSqlrails
Newsletter
I'm working on sending out a weekly newsletter. I'll make it as easy as possible to unsubscribe at any time.