class ForumUserImage < ActiveRecord::Base
  belongs_to :album_id
  belongs_to :forum_user
  
  attr_accessor :original_imagename
  
  #attr_accessible :description, :image, :title, :views, :original_imagename
  
  mount_uploader :image, UserImageUploader
  
  
	def rotate(degrees=90)
		versions = [self.image.path, self.image.large.path, self.image.thumb.path]
		
		versions.each do |v|
			image = Magick::ImageList.new(v)
			image = image.rotate(degrees)
			image.write(v)
		end
		self.updated_at = Time.now
		self.save
	end
  
  
end
