Skip to content

Instantly share code, notes, and snippets.

View pierrevalade's full-sized avatar

Pierre pierrevalade

View GitHub Profile
class Category
# name is book, movie
attr_accessor :name, :path
def initialize(n, path)
self.name = n.to_s # movie, book
self.path = path
end
module Paperclip
class ThumbnailWithDimensions < Thumbnail
def initialize(file, options = {}, attachment = nil)
super
attachment.instance_write(:width, @current_geometry.width)
attachment.instance_write(:height,@current_geometry.height)
end
end
end