I have a User model which has_many Roles and the Role has many users, all through an intermediate table. At the end Role has_many/has_one goal. I want to reach goals through user or let me say I want to do something like User has_many :goals through :roles. When I do it and try to set user.goals = Goal.all. It gives following exception.
ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection: Cannot modify association 'User#goals' because the source reflection class 'Goal' is associated to 'Account' via :has_one.
Is there any way to achieve this. I don't see anything like that on RailsAPI.