Understanding reject_if in Ruby on Rails
I recently stumbled upon a Rails pitfall that led to unwanted records cluttering pur database, and while trying to fix it I stumbled upon reject_if. The Problem My journey began with a User model...
I recently stumbled upon a Rails pitfall that led to unwanted records cluttering pur database, and while trying to fix it I stumbled upon reject_if. The Problem My journey began with a User model...
Story time I was experiencing an issue with a ruby gem that handles file uploads in administrate. The delete button for it wasn’t working, because it wasn’t using Turbo correctly. So, I went ahead...
Story time Recently, we had an interesting situation: someone entered “Nigeria 🇳” as a zip code. Yes, with an emoji. Lesson This got us talking about data validation. If we allow emojis or other u...
When contributing to open source, submitting a pull request (PR) is often more effective than just opening an issue. While raising issues is important, a PR demonstrates your idea in action and mak...
There is a point in time where you just stop needing a column in the database. The most logical approach is to delete it, but it turns out this isn’t the smartest thing to do. Story time One of my...
Making a migration means changing the database, which is always a risky thing. Having a backup of our database is one thing, but it is better if we don’t resort to it. We should always test rollin...
Adding a column, changing a data type, or dropping a table can irreversibly affect your data. A wrong migration can destroy production data and make a rollback impossible without losing integrity. ...
How to include the child model's fields in the dashboard and be able to search through them.
How to include the child model's fields in the dashboard and be able to search through them.
What is the Open-Closed Principle? The Open-Closed Principle (OCP) is one of the five SOLID principles. It states that “software entities (classes, modules, functions, etc.) should be open for exte...