My Rails app deals a lot with data from third-party APIs (specifically UPS, FedEx, DHL, etc).
What I d like to do is whenever that data comes in, replace certain phrases with customized phrases.
Example: "On FedEx vehicle for delivery" (which we get from the FedEx API), I d like to replace with "Out for Delivery."
Is it best to replace the the text on its way in to the database? Or on output? (Talking from an end-user speed perspective)
I m planning on storing these phrases in our database, so I m assuming I d just create a helper that pulls the phrases I want to replace and then run the strings through those using gsub and replace as necessary?
Any tips on making this efficient and easy to manage would be great.