I'm fairly new to rails, and working on an app which essentially allows users to report grievances about other users (just a fun app i want to use with friends). Basically there are just two models, users and reports. A user has many reports and reports belong to a user (ie. a user is associated to reports submitted about them)
Basic model structure:
class User<ApplicationRecord
has_many :reports
end
class Report<ApplicationRecord
belongs_to :user
end
Right now, users can submit new reports and select from a dropdown which user to associate it with, but I would also like to add an association between the report and the user who submitted the report so that I can go through the reports that a user has made and find the user they reported about most. (ie. I want users to have many reports which were written about them and have many reports which they wrote about others)
I don't know how to accomplish this because i need to distinguish this has_many/belongs to relationship from the one I have above. Any ideas?