Be careful relying on YourModel.connection.schema_cache.clear! and YourModel.reset_column_information. We noticed some strange errors while calling it a lot under load. Instead, if you can avoid using it (best option) or do a rolling restart of Puma via its tmp_restart plugin (works great and handles requests in process like a champ, but delays requests and could be a horrible idea under load), either of those options might be better choices.
- Try not to change column names (and possibly table names) in any DB referred to directly by Rails.
- Be careful with any gem or code that will search through all columns in an ActiveRecord model.
- In Rails 5, you could be diligent about adding ignored_columns to models any columns you plan to rename or delete.
- You could patch your model/define it's columns so that it accurately reflects columns you plan to delete or want to ignore, such that it disregards them.