You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class User extends AppModel {
public $actsAs = array('Containable', 'HabtmCounterCache');
public $hasAndBelongsToMany = array(
'Follower' => array(
'className' => 'User',
'joinTable' => 'relationships',
'foreignKey' => 'followed_id',
'associationForeignKey' => 'follower_id',
'unique' => 'true' // If you do not want records to be deleted
),
'Following' => array(
'className' => 'User',
'joinTable' => 'relationships',
'foreignKey' => 'follower_id',
'associationForeignKey' => 'followed_id',
'unique' => 'true' // If you do not want records to be deleted
)
);
I have added two columns namely follwer_count and following_count at user model. But its not updating the counter.
The text was updated successfully, but these errors were encountered:
My User model is like this:
class User extends AppModel {
public $actsAs = array('Containable', 'HabtmCounterCache');
I have added two columns namely follwer_count and following_count at user model. But its not updating the counter.
The text was updated successfully, but these errors were encountered: