Sha256: 31eb5d177d8a2ff1f53514f7c8f574fb53d50a38a0a301d2371ee5d61e36b76d
Contents?: true
Size: 593 Bytes
Versions: 8
Compression:
Stored size: 593 Bytes
Contents
class FamilyGallery::UserTagging < ActiveRecord::Base belongs_to :picture belongs_to :tagged_by, class_name: "User" belongs_to :user validates_presence_of :picture, :user, :tagged_by, :position_left, :position_top validates_uniqueness_of :user, scope: :picture scope :ordered, -> { joins(:user).order("family_gallery_users.first_name, family_gallery_users.last_name, family_gallery_users.email") } def left_for_width(width) return (width * (position_left.to_f / 100)).to_i end def top_for_height(height) return (height * (position_top.to_f / 100)).to_i end end
Version data entries
8 entries across 8 versions & 1 rubygems