Here’s my situation which I’d be thankfull to get a response that gets me on the right track to a solution:
I have two different models. USERS and POSTS. Untill the present moment I have a pretty straight forward relationship between them.
USER: has_many :posts, :dependent => :destroy
POST: belongs_to :user
This is working fine, but I want to add a different behaviour to it.
I want a USER to also have the ability to set an original AUTHOR to the content of his POST.
In other words, a POST belongs to a USER (submitter who’s posting some content) and also belongs to an original AUTHOR(a person who’s post content is originaly from).
A new model AUTHOR would solve this problem easily. But the issue is that the AUTHORS table would have the same exact data as the USERS table.
This is because all of my USERS, are also considered AUTHORS. And that being said, I shouldn’t really have a new model called AUTHORS cose it would be a duplicate.
I need a way to refer to the USERS table as AUTHORS as well. So USER 1 is also an AUTHOR 1. All living in the same table.
Thought about polymorphic associations but after a whole day of researches I am not convniced that this is the correct aproach to it. And if it is, how would that be done.
I thank you in advance for any considerations on this subject. Please let me know if there is any other code you need to visualize in order to come up with a solution path.