# Problem accessing paperclip file attributes in a callback (observer)

**URL:** <https://www.ruby-forum.com/t/problem-accessing-paperclip-file-attributes-in-a-callback-observer/176292>\
**Category:** Rails\
**Created:** [September 28, 2009, 5:07pm UTC](https://www.ruby-forum.com/t/problem-accessing-paperclip-file-attributes-in-a-callback-observer/176292 "2009-09-28T17:07:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolmenu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/eada6e/32.png) [@coolmenu](https://www.ruby-forum.com/u/coolmenu)\
**Post date:** [September 28, 2009, 5:07pm UTC](https://www.ruby-forum.com/t/problem-accessing-paperclip-file-attributes-in-a-callback-observer/176292/1 "2009-09-28T17:07:20Z")

</div>

I’m having trouble accessing paperclip file attributes in an  
after\_destroy callback on my attachment model. I can’t seem to access  
the paperclip-managed attributes but I can access non-paperclip  
attributes. Here’s an example:

class AttachmentObserver \< ActiveRecord::Observer  
def after\_destroy(attachment)  
attachment.logger.info “Deleted #{attachment.user.username} :: #  
{attachment.name}”  
end  
end

The log message will say "Deleted Jsmith :: ". No attachment name  
though. Thanks for any help.

Here’s a gist if you need it.

> <https://gist.github.com/193623>
