Sha256: c687a30711034ca6d882fe1660d71e82f5e88f031b75a127d57ae624afa99d86

Contents?: true

Size: 370 Bytes

Versions: 11

Compression:

Stored size: 370 Bytes

Contents

module Spina
  class Option < ApplicationRecord
    has_one :page_part, as: :page_partable
    has_one :layout_part, as: :layout_partable
    has_one :structure_part, as: :structure_partable

    def content
      I18n.t(['options',part.name,value].compact.join('.'))
    end

    private

    def part
      page_part || layout_part || structure_part
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spina-1.2.0 app/models/spina/option.rb
spina-1.1.4 app/models/spina/option.rb
spina-1.1.3 app/models/spina/option.rb
spina-1.1.2 app/models/spina/option.rb
spina-1.1.1 app/models/spina/option.rb
spina-1.1.0 app/models/spina/option.rb
spina-1.0.3 app/models/spina/option.rb
spina-1.0.2 app/models/spina/option.rb
spina-1.0.1 app/models/spina/option.rb
spina-1.0.0 app/models/spina/option.rb
spina-0.12.0 app/models/spina/option.rb