Sha256: 8758ef178352844ac41d5dcbf2c2b892aaf46d30b7ea7a0358c1238340ec6b63
Contents?: true
Size: 492 Bytes
Versions: 34
Compression:
Stored size: 492 Bytes
Contents
module Para class ComponentSection < ActiveRecord::Base 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
34 entries across 34 versions & 1 rubygems