Sha256: 381038ac7ad84feb2c2397965beecb2feba63fef8b7c6d18e6318945fd91c30f
Contents?: true
Size: 469 Bytes
Versions: 4
Compression:
Stored size: 469 Bytes
Contents
module Spotlight class MainNavigation < ActiveRecord::Base belongs_to :exhibit, touch: true default_scope -> { order("weight ASC") } scope :browse, -> { where(nav_type: "browse").take } scope :about, -> { where(nav_type: "about").take } 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
4 entries across 4 versions & 1 rubygems