Sha256: ca319a8c1bd350cebcd2a03f3917028255fe0744ade927863d32bc6ed2fd39b0

Contents?: true

Size: 550 Bytes

Versions: 1

Compression:

Stored size: 550 Bytes

Contents

module Headmin
  module Field
    extend ActiveSupport::Concern

    included do
      # Configuration
      has_closure_tree
      # Associations
      belongs_to :fieldable, polymorphic: true, optional: true, touch: true
      belongs_to :field, optional: true, touch: true
      has_many :fields, foreign_key: "parent_id"
      accepts_nested_attributes_for :fields, allow_destroy: true

      # field_type: :files, :file
      has_many_attached :files
      accepts_nested_attributes_for :files_attachments, allow_destroy: true
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
headmin-0.5.2 app/models/concerns/headmin/field.rb