Missing file after update
Reported by Jaime Iniesta | May 1st, 2008 @ 02:29 PM
(Solved!)
Hi!
I don't know if I've run into a bug or something, but here it goes...
I have an User model with an avatar paperclip. The first time I edit the user to upload its avatar it works OK and the images are there.
But then if I edit the user again, just to change its name, for example, it's avatar is lost. It seems like, if you don't send a file every time you update, it deletes the previously attached file.
Here goes the log for that last update:
#######################
Processing UsersController#update (for 127.0.0.1 at 2008-05-01 20:23:37) [PUT]
Session ID: BAh7CDoOcmV0dXJuX3RvMDoMdXNlcl9pZGkGIgpmbGFzaElDOidBY3Rpb25D%0Ab250cm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--2fee4ea2bc19fa6c30a87275b8a125537c2347d3
Parameters: {"user"=>{"password_confirmation"=>"", "avatar"=>"",
"login"=>"jaimeiniesta", "password"=>"",
"email"=>"jaimeiniesta@gmail.com"}, "commit"=>"Update",
"_method"=>"put", "action"=>"update", "id"=>"1",
"controller"=>"users"}
User Columns (0.001121) SHOW FIELDS FROM `users`
User Load (0.000076) SELECT * FROM `users` WHERE (`users`.`id` = 1)
SQL (0.000098) BEGIN
User Load (0.000437) SELECT * FROM `users` WHERE
(LOWER(users.login) = 'jaimeiniesta' AND users.id <> 1) LIMIT 1
User Load (0.000236) SELECT * FROM `users` WHERE
(LOWER(users.email) = 'jaimeiniesta@gmail.com' AND users.id <> 1)
LIMIT 1
User Update (0.000307) UPDATE `users` SET `created_at` =
'2008-05-01 18:18:23', `login` = 'jaimeiniesta', `crypted_password` =
'7fa8077254146c2bcff4b286e1f2c708ed3f9cec', `activated_at` =
'2008-05-01 18:18:38', `remember_token_expires_at` = NULL,
`activation_code` = NULL, `salt` =
'598e23dee465f4feaeabc7b476c104d787541b13', `avatar_file_size` = NULL,
`avatar_file_name` = NULL, `remember_token` = NULL, `email` =
'jaimeiniesta@gmail.com', `avatar_content_type` = NULL, `updated_at` =
'2008-05-01 18:23:37' WHERE `id` = 1
SQL (0.003058) COMMIT
Redirected to http://localhost:3000/users/1
Completed in 0.02164 (46 reqs/sec) | DB: 0.00533 (24%) | 302 Found
#######################
Thanks!
Comments and changes to this ticket
-
Chad Pytel May 1st, 2008 @ 07:52 PM
- → State changed from new to invalid
As mentioned on the mailing list, this was previously fixed in trunk.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
