There are scenarios where a combination of columns needs to be used as the primary key. This is where composite primary keys come into play. This article explores composite primary keys, how they work in Rails, when they should be used, and what to consider when using them.
Rails Concerns are helpful but can be confusing for new and experienced developers alike. This article explains what Rails Concerns are and how to use them to improve your workflow.
Ruby lets you express yourself like few other languages, with a minimum of boilerplate. It's fantastic until it isn't. Until one day when you think you're calling the
foo method you wrote last week, but instead, you end up calling a
foo method that came with some gem from 2008. In these situations, knowing about Ruby's method lookup rules will save your bacon.
Few things are scarier than a database slowly losing integrity over weeks or years. For a while, nobody notices anything. Then users start reporting bugs, yet you can't find any code that's broken. By the time you realize the problem, it may be happening for so long that your backups are unusable. We can avoid problems like these with skillful use of transactions. In this article, Kingsley Silas introduces us to transactions at the database level, discusses when they should be considered, and shows us how to use them in Rails.