I want to have a Status model that will be relatively static after a certain user setting (and different users may have different status values).
Status can apply to various models, such as Contact and Event .
therefore, the statuses returned by contact.status will be different from event.status
I want to create an application so that the status table has different types ( contacts and events ).
What is the right strategy and format for this?
I am thinking of declaring :has_one Status in the Contact model and saving :status_id in the table :contacts . Also with Event .
:statuses table will have a status value, type and date.
it makes sense? Can you suggest a better approach?
ruby-on-rails belongs-to
Angela
source share