Reputation: 62
I got the following problem: I have a rails4 application with a postgresql. The database contains data that is imported from different sources. These sources have different priorities (or 'validities'). There are sources that are quite unreliable and sources that are very reliable and there are editors who's updates have a higher priority than all import sources.
In order to track the prioritiy/validity of the content of a field, I'd like to attach a 'validity-value' (a smallint would suffice) to every field. An importer would only update the field if it has a higher priority than the existing field.
A:) Is there a better way to do this in postgres than adding an additional FIELDNAME_validity to the tables for every field?
B:) Is there a gem or a built-in active record functionality that deals with this (metadata on attributes). If not, do you have ideas how to extend active record in order to automate this as much as possible?
Thanks, Rick
Upvotes: 1
Views: 437