Hi,
Total noob question. Would greatly appreciate any pointers.
I have a rails model that includes 2 possible values for a concept, e.g., distance (a value from a GPS file and an edited value). It's possible to have a value in either column (just file or just manual), both (manual overwrites file in this case), or neither:
distance-file distance-edited
9
10 11
12
In several places in my app, I want to do a find and sort the results by distance, where file vs. edited matters only in that I want to use distance-edited when present.
Because I do this sort in many places, ideally I'd like to centralize the logic for picking which distance value to use somewhere so in each find I can simply sort on distance.
What's the right way to do this?
Thank you!
Olivia