milesj / uploader

[Deprecated] A CakePHP plugin for file uploading and validating.
MIT License
193 stars 73 forks source link

findById - does not support PK like user_id #101

Closed eldad87 closed 11 years ago

eldad87 commented 11 years ago

Hi, In AttachmentBehavior::deleteFiles and AttachemntBehavior::_cleanupOldFiles you used $model->findById($model->id);

In my projects, instead of using id as PK I'm using the Table_Name_id (I.e user_id, subject_id etc). Can you please support this case by changing the search into to: $model->find('first', array('conditions'=>array($model->primaryKey=>$model->id)));

thanks!

milesj commented 11 years ago

Makes sense, will change.

milesj commented 11 years ago

Fixed in 4.0.5

https://github.com/milesj/Uploader/commit/60b12a15a69e8faa1191cbdb50cc3eefce77da5c