Ensure each entity type was changed properly in project wide search and replace

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the dumb-mistakes-and-gotchas category.

Last Updated: 2024-03-28

I ran some vim macros to rename tutor_discipline_availabilities to law_discipline_offerings across my project.

Now for a bit of Ruby context: ruby has both normal unadorned variable names/functions - e.g. tutor_discipline_availabilities and symbols (a bit like singleton value strings - :tutor_discipline_availabilities)

Now, my regex worked for normal functions, but when it acted on symbols (i.e. :tutor_discipline_availabilities), it did not preserve the colon in front. I committed this error and it sneaked up on me later.

Lesson

When searching and replacing project-wide in future I should

-- Tutor.joins(:tutor_discipline_availabilities)
++ Tutor.joins(tutor_discipline_availabilities)