OK here’s the deal. I have a Verification object that I want to use
to allow users to verify data (Posts, Pics, Addresses, etc). Each
Post, Address, etc object will be related 1:1 to a Verification
object.
But I want to have the Verification keep 3 separate lists of users. I
have generated the following migration code, but i don’t think it’s
going to work properly:
def self.up
create_table :verifications do |t|
t.references :voted_real
t.references :voted_fake
t.references :flagged
t.timestamps
end
See I want voted_real to be a list of users who have voted “Real”,
similarly :voted_fake should be a list of users who have voted “Fake”
and flagged to be a list of users who have “flagged” content (as
offensive, inappropriate, etc).
So you see, the standard options for ActiveRecord Associations will
not suffice (as far as I can tell).
Can someone help me out here? I maybe just need a different design or
maybe I can use polymorphic associations, but I’m not sure yet. I
think I can use polymorphic associations to associate the
Verifications to the other objects, but not to accomplish what I want
to do with the Verification to User relationship(s).
I appreciate your help!!
-Steve