Accessing Activerecord Relations In Dataprovider ($Data)

I am trying to access models via relationships inside of a CListView view file. Accessing the data via $data works, so does the first relationship ($data->anotherModel) but trying to go any futher doesn’t seem to work ($data->anotherModel->anotherModel).

I have a feeling I’m trying to go about this the wrong way, should I be eager loading the relationship models when I create the data provider?

Thanks for the help

edit: The error is "Trying to get property of non-object" when trying to access the nested relationship

Solved my own problem, the first model had a HAS_MANY and should have had a HAS_ONE relationship with the second model.