Paperclip Interpolation

Hi, Im trying to save my file by an id from a 3rd table, the db looks like this

[B]Page <--------------- Document <------------ Edition

id ---------------------- id ----------------------------- id
document_id ----- edition_id

So what Im trying to do is to get the edition_id so the path file would look like /edition_id/document_id/file.extension

I know that I could just add the edition_id to Page, but I want to know if there is a solution without doing that.