Paperclip polymorfic problem with :styles

I made a model Picture that is polymorfic but I want to specify
specific :styles for each model that use Picture.

http://pastie.org/1034662

I don't know how to this, I used lambda for this but he doesn't know
the data.instance.picturable on submit. It returns always nil.

I made a model Picture that is polymorfic but I want to specify
specific :styles for each model that use Picture.

http://pastie.org/1034662

I don't know how to this, I used lambda for this but he doesn't know
the data.instance.picturable on submit. It returns always nil.

My memory is that you can't do this. The has_attachment code gets evaluated long before any specific model associations are present. And the style definitions aren't lazily loaded. Or something.

In any event I tried to do something similar to what you're doing and it doesn't work.

-philip