Attachment_fu dynamic max_size

I’m using attachment_fu for uploading photos. I’d like to set the
max_size parameter based on the user’s account level. So I have a field
in the account_plans table that stores the max_size allowed for that
plan.

This doesn’t work, but it should give an idea of what I’m trying to
achieve…

has_attachment :content_type => :image,
:storage => :s3,
:path_prefix => ‘public/uploaded_photos’,
:max_size =>
self.event.account_plan.max_filesize.kilobytes,
:s3_access => :public_read

What is the correct way for me to do this?

Thx
Nick