My Rails app has a User model and an Idea model. Each user can have many ideas, and each idea belongs to one user (or none). Users take ownership of an idea using the Idea controller’s claim action, and release ideas using the release action.
So far, really simple. But I’ve just realized I want this to do a bit more, and now I’m not sure how to proceed: Basically, I want users to be able to “report” ideas for being bad/invalid ideas, along with a note specifying the reason for the report.
I would also like to keep track of metrics regarding to claiming ideas — how long an idea was claimed for before being marked as submitted (it’s for managing blog posts), and so on.
In an unrelated question, someone suggested I need a Claim model in my app for this sort of complex tracking. This makes sense to me, but I’m really not sure how that model would be structured, and how it would work. Would it be like a log? If so, how would I figure out what’s the current idea status for each idea?
Any insights on this would be most welcome.
I think, since you need a log of all user actions its better if you keep Reports and Claims independent.
So, it might look along the lines of
User
has_manyIdeasIdea
has_manyClaimsIdea
has_manyReportsCode:
And since, rails migration would add columns for time-stamps. you would be able to calculate the time differences between change of status etc.