CakePHP hasOne association conditions
Hi I am building my User model to have only one profile picture, which is an example of an Image model. I want the conditions of the hasOne to only include the image where the Image.id is equal to the "picture" column in the user table. I know there is something wrong...here is the relevant part of code.


        var $hasOne = array(
                'ProfileImage' => array(
                        'className' => 'Image',
                        'conditions' => array('ProfileImage.id' => 'User.picture'),
                        'dependent' => false,
                        'foreignKey' => 'user_id',
                )
        );

What is wrong with my conditions? How do I specifc ProfileImage.id to be equal to the picture column in the User model? Thanks!
CakePHP hasOne association conditions
===

Hi I am building my User model to have only one profile picture, which is an example of an Image model. I want the conditions of the hasOne to only include the image where the Image.id is equal to the "picture" column in the user table. I know there is something wrong...here is the relevant part of code.


        var $hasOne = array(
                'ProfileImage' => array(
                        'className' => 'Image',
                        'conditions' => array('ProfileImage.id' => 'User.picture'),
                        'dependent' => false,
                        'foreignKey' => 'user_id',
                )
        );

What is wrong with my conditions? How do I specifc ProfileImage.id to be equal to the picture column in the User model? Thanks!