1 class PanelPicture < ActiveRecord::Base
3 belongs_to :resource_picture
5 validates :width, :presence => true, :numericality => true, :not_zero => true
6 validates :height, :presence => true, :numericality => true, :not_zero => true
9 res = (self.height < 0 ? '' : 'v') + (self.width == 0 ? '' : 'h')
10 res += '/' unless res.empty?
15 flip + self.resource_picture.filename
19 '/resource_pictures/' + filename