Tutorials



Seed your database with the Faker gem. Then seed 9.4x faster with upsert_all and activerecord-import.
I cover 3 things in this article —Using the faker gem in a Rails app to seed 10,000 fake records.Fixing our slow seeds by making them 9.4x faster, using upsert_all or the activerecord-import gem (since our naive method is very inefficient).Finally...


Polymorphic Relationships in ActiveRecord - dick.codes
I was recently implementing a feature to support billing multi-user accounts when I realized my initial approach was missing something. It became clear as I progressed that I made a mistake in assuming the work I was doing on creating multi-user a...


Tweaking Emacs for Ruby Development in 2023 · John Hamelink
Since I started a new job in April, I’ve been spending the majority of my time with legacy Ruby code for the first time since 2017 (I’d been mainly working on Elixir and Typescript codebases between then and now).Before my start-date at the new jo...


Implementing Rails-like Controllers in a No-Rails App
This post shows how you can implement Rails-like controllers in a Ruby-based web application for a better understanding of Rails controllers.In its essence, a controller class in Rails is a coordinator. It accepts the incoming HTTP request and bui...