I have two separate has many through one relationships pointing to the same objects.
- Users have many photos through photo_relationships
- Users have many photos through votes
In my controller I'm trying to show all of the photos for the user through this code:
@user = User.find(params[:id])
@photos = @user.photos
However, the Inner Join is being controlled by whatever has_many relationships is mentioned last in the User model, in this case votes. Is there a way to specify what inner join is used such as:
@photos = @user.photos( joins: :photo_relationships)