Sha256: 6878afa692196a9020dcea0e65c16d1652629a39c37232c4ea2fcaa6053ea1ab
Contents?: true
Size: 584 Bytes
Versions: 66
Compression:
Stored size: 584 Bytes
Contents
module Spotlight ## # Exhibit navbar links class MainNavigation < ActiveRecord::Base belongs_to :exhibit, touch: true default_scope { order('weight ASC') } scope :browse, -> { find_by(nav_type: 'browse') } scope :about, -> { find_by(nav_type: 'about') } scope :displayable, -> { where(display: true) } def displayable? display? end def label_or_default if label.present? label else default_label end end def default_label I18n.t(:"spotlight.main_navigation.#{nav_type}") end end end
Version data entries
66 entries across 66 versions & 1 rubygems