Sha256: de4c6570bc319a9c19ae667c683149735012266c0da583e75fd84c28f1f05ea0
Contents?: true
Size: 499 Bytes
Versions: 42
Compression:
Stored size: 499 Bytes
Contents
module Virgo class Slide < ActiveRecord::Base belongs_to :slideshow, touch: true belongs_to :image scope :by_position, ->{ order(position: :asc) } # validation disabled on editors' request # validate :has_video_or_image def video? video_embed.present? end private def has_video_or_image if video_embed.blank? && image.blank? errors[:base] << "Slide must include either a video embed or an image attachment." end end end end
Version data entries
42 entries across 42 versions & 1 rubygems