Rails ActiveRecord callbacks make validation a breeze, but what happens if you want to verify that a record has at least one attribute present, but you don’t care which attribute it is? This was a recent case I was working on for a client who was having their operators fill in a form with a lot of uncertainty. They couldn’t know which record would be needed, but we didn’t want to allow all records to be blank.
Vim has changed the way I work in a massive positive way, but I spent over a year giving up and coming back before it finally stuck. This is what worked for me.
Sometimes you have to change a table name. When you do, don’t forget to update ActiveStorage relationships otherwise your files will be orphaned.
ActiveStorage in Rails 5.2 is awesome, but where do handle deleting attachments on the controller? Here are some possible options.
Calling attributes of associated records isn’t “directional”. Or, how I learned to stop worrying and love foreign keys.
Go beyond delivering just full_messages in Rails to send well formatted error messages using Rails API
Want to use Font Awesome 5 with the Rails Asset Pipeline and Turbolinks? Read on to find out what you need.
Building custom user authorization that integrates into Devise’s current_user helper.