I need some help with designing a model I have in mind. I’m not sure
what the best way to do it in Ruby/Rails is, or even if what I’m
thinking is possible.
Basically, I have a system where I want to treat everything as a
“message.” A Message is a basic model object with a title and
message_text. It can stand on it’s own, or it can be “converted” into a
more complex object like a task, or a project. Tasks and Projects all
have titles and message_text, so it seems silly to make them entirely
separate models, especially because I want to be able to easily convert
any message to a different type. But, tasks and projects will have
their own, separate data such as a start_date, end_date and more. From
a DB design standpoint it would seem logical to have a messsages table
and tasks and projects tables that would have a foreign key to a
message. But I’m not sure that makes sense in a Rails model. What is
the best way to represent this in Rails?