Sha256: 7600751bb049ea47bd3060238bc0815daed7f60a3a4e3357ab367a01377eac0a
Contents?: true
Size: 553 Bytes
Versions: 12
Compression:
Stored size: 553 Bytes
Contents
module Para class ComponentSection < Para::ApplicationRecord has_many :components, -> { ordered }, class_name: 'Para::Component::Base', autosave: true, foreign_key: :component_section_id, dependent: :destroy scope :ordered, -> { order(position: :asc) } validates :identifier, presence: true def name read_attribute(:name) || ::I18n.t( "components.section.#{identifier}", default: identifier.humanize ) end end end
Version data entries
12 entries across 12 versions & 1 rubygems