UPDATE: This was fixed by:
-
Deleting ratings table & rating.ex file
-
Re-running context gen command for Rating
-
Updating the schema in rating.ex to the following:
belongs_to: :user, Pento.Accounts.User
belongs_to: :product, Pento.Catalog.Product
-
Update changeset along with the book
-
Re-run mix ecto.migrate
-
Keep all other files i.e. demographics etc. the same
Now all associations are loaded in survey/query & product/query correctly.
I’m not sure why the association has to be explicit in this case, but I’m finally to be free from the roadblock - FYI if you happen to see anything like this in future, Sophie/Bruce and all other readers.