So I have a Status table (with an id and a name column), it has rows like “Pending”, “Done”, etc. I also have a Data table with things like id, name, comment, etc. I want each Data row to have a status, so the logical thing looks like putting a status_id into the Data table, but how do I represent that in RoR? has_one seems to be working the other way around.
So I have a Status table (with an id and a name column), it
Share
Read http://guides.rubyonrails.org/association_basics.html#choosing-between-belongs_to-and-has_one and read this paragraph
2.7 Choosing Between belongs_to and has_one