Sha256: 199cdf36a12d7f58c02530062e2afd00c162e7c96d67e3ff7fcf5fb45ca40efe
Contents?: true
Size: 375 Bytes
Versions: 8
Compression:
Stored size: 375 Bytes
Contents
module Redde::Photoable extend ActiveSupport::Concern included do belongs_to :imageable, polymorphic: true default_scope { order(:position) } before_save :set_token, unless: :persisted_link? end def set_token token = SecureRandom.uuid unless token.present? end def persisted_link? imageable_type.present? && imageable_id.present? end end
Version data entries
8 entries across 8 versions & 1 rubygems