Sha256: 453f325122f4ecd91f172d7c1fe80c4508e1eafc7ea97daf728b43029bb79874
Contents?: true
Size: 597 Bytes
Versions: 13
Compression:
Stored size: 597 Bytes
Contents
# frozen_string_literal: true # Defines a relationship between a BitCore::Slideshow and a "target", which for # now is limited to the home screen of a Participant. class SlideshowAnchor < ActiveRecord::Base TARGET_NAMES = %w(home_intro).freeze belongs_to :slideshow, class_name: "BitCore::Slideshow", foreign_key: :bit_core_slideshow_id validates :slideshow, :target_name, presence: true validates :target_name, inclusion: { in: TARGET_NAMES }, uniqueness: true def self.fetch(target_name) find_by_target_name(target_name.to_s).try(:slideshow) end end
Version data entries
13 entries across 13 versions & 1 rubygems