See previous commit. This isn't nice, but it does the same job as the gem did. We can also update this code now as Rails changes (the gem was incompatible with Rails 7).