79179733

Date: 2024-11-12 03:57:47
Score: 1.5
Natty:
Report link

The error occurs because the Tag model does not have an association defined for tagged.

To resolve this, you can either add a belongs_to :tagged association in the Tag model or explicitly reference the column name as the answer of @pungoyal:

tags = Tag.where(game_id: 1, tagged_id: u.id).includes(:tagged)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • User mentioned (1): @pungoyal
  • Low reputation (0.5):
Posted by: Trang Tung Nguyen