Sha256: cd0ebba7c77996830f29321062159a7625f1648558acf082a16782d2c1802c91
Contents?: true
Size: 646 Bytes
Versions: 11
Compression:
Stored size: 646 Bytes
Contents
module Spina class LayoutPart < ApplicationRecord include Part include Optionable belongs_to :account belongs_to :layout_partable, polymorphic: true accepts_nested_attributes_for :layout_partable, allow_destroy: true validates_uniqueness_of :name, scope: :account_id alias_attribute :partable, :layout_partable alias_attribute :partable_type, :layout_partable_type alias_method :layout_partable_attributes=, :partable_attributes= def position(theme) layout_parts = theme.layout_template[:layout_parts] layout_parts.index { |layout_part| layout_part == self.name }.to_i end end end
Version data entries
11 entries across 11 versions & 1 rubygems