Sha256: 7937b4b7b42fff7990b2480b6aa480cdf0dc950e5e8f3635359fa8ca5c6e8ce1
Contents?: true
Size: 410 Bytes
Versions: 40
Compression:
Stored size: 410 Bytes
Contents
class Redde::Photo < ActiveRecord::Base mount_uploader :src, PhotoUploader self.table_name = 'redde_photos' belongs_to :imageable, polymorphic: true default_scope { order(:position) } before_save :set_token, unless: :persisted_link? def set_token self.token = SecureRandom.uuid unless token.present? end def persisted_link? imageable_type.present? && imageable_id.present? end end
Version data entries
40 entries across 40 versions & 1 rubygems