Cakephp - 模型X与模型Y无关

I'm getting an error when I try to retrieve data from model using the code snipet bellow:

$this->paginate = array(          
        'limit' => 7,
        'contain' => array(
            'AvailabilityInterval' => array(
                'Appointment'
            )
        ),
    );
$availabilities = $this->paginate('Availability');

Availability is related to the AvailabilityInterval using hasMany relation, AvailabilityInterval is related to the Appointment model using hasMany relation. When I try the code above I'm getting an error "Model "AvailabilityInterval" is not associated with model "Appointment".

var $actsAs = array('Containable');

is added to the AppModel class.

I've tried to add $this->AvailabilityInterval->getAssociated(); before the $this->pagine... code snipet and everything works fine.

Could anyone help me to resolve this issue?

Thanks in advance.

Try:

$this->paginate = array(          
    'limit' => 7,
    'contain' => array(
        'AvailabilityInterval' => array(
            'fields' => array(
                'Appointment'
            )
        )
    ),
);
$availabilities = $this->paginate('Availability');