Conditional image resizing (file_column)

Hi I´m using file_column plugin. I have a model (banner) with a field image. I need to resize this field in diferent sizes depending on the value of other field of the same model (level).

Normally I don´t have this requeriment and I define image file_columns this way: file_column :image, :magick => { :versions => { "thumb" => "130x150","med" => "380x305","gr" => "600x400"} }

Is it posible to access model instance variables in the file_columns definition? If not, Is it possible to redefine file_column-magick versions in a callback?.

Perhaps I´m missing something, What´s the best way to achieve this?

Thanks.

--Alfredo--

Normally I don´t have this requeriment and I define image file_columns this way: file_column :image, :magick => { :versions => { "thumb" => "130x150","med" => "380x305","gr" => "600x400"} }

Is it posible to access model instance variables in the file_columns definition?

sure, you can always replace a string by some erb output file_column :image, :magick => { :versions => { "thumb" => "130x150","med" => "<%= @image.level == 1 ? "380x305" : "480x405" %>","gr" => "600x400"} }

would put 380x305 if @image.level is 1 otherwise use "480x405" There are a lot of ways to do this, depending on your needs. In the end it's all text and can be conditionaly replaced with erb