Attachment_fu and observers/emailing

Hi all,

I’m developing a site where a user can upload their CV/resume with a
profile, and am using restful_authentication for this with
attachment_fu to handle the file uploading.

When a user creates their profile/user account, I’ve got an observer
that will email the site admin with a copy of the uploaded CV. My
user_observer looks something like:

class UserObserver < ActiveRecord::Observer
def after_create(user)
UserMailer.deliver_signup(user) unless user.activation_code.blank?
UserMailer.deliver_notification(user)
end
end

The problem I’m having is when the deliver_notification method is
called, I get an error reporting:

No such file or directory - /users/0000/3472/alastairmoore.cv.pdf

Now I’m guessing that attachment_fu hasn’t moved the file from a
temporary location to /users/0000/3472 by the time the observer fires
off. Would this be correct and if so, can anyone suggest a way round
this?

Many thanks,

Alastair

Ok, problem solved. It was a path error.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs