Hi. I’m trying to call the function ‘store_description(image)’ at line
9. However when I do, I get the error “undefined method
‘store_description’ for Photo:Class”. What can I do?
1: class Photo < ActiveRecord::Base
2: def store_description (image)
3: self.description = "size:
"+number_to_human_size(image.filesize)
4: end
5: file_column :image, :magick => {
6: :versions => {
7: “thumb” => {
8: :transformation => Proc.new { |image|
9: store_description(image) # what do I put
here???
10: image.change_geometry!(‘160x120’) { |cols,
rows, img|
11: img.thumbnail!(cols, rows)
12: }
13: },
14: :attributes => { :quality => 50 }
15: }
16: }
17: }
18: end
Thanks!