Hi,
I have a belongsTo relationship with a counterCache set correctly. The problem being that this relationship is not always there.
For example Users don't always have a link to an address so the DB allows nulls.
But the counterCache is always trying to update, even when the foreign key is NULL.
E.g.
UPDATE [addresses] SET [user_count] = 0 WHERE [id] IS N''
Is there something I can put into the counterScope to stop this error from happening on NULL id's??
Thanks in advance.