Sha256: 252c0c081b0f81459459ad312c20a97e44ffc6e151624abf34a3c3273fdc80f5

Contents?: true

Size: 393 Bytes

Versions: 3

Compression:

Stored size: 393 Bytes

Contents

class PartObject < ActiveRecord::Base
  
  has_many :part_object_fields, class_name: "PartObjectField", foreign_key: "part_object_id", dependent: :destroy
  # belongs_to :base_model, inverse_of: :part_objects, foreign_key: "base_model_id"
  belongs_to :part
  
  accepts_nested_attributes_for :part_object_fields, allow_destroy: true

  scope :by_position, -> { order('position ASC') }
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activeadmin-magicfields-0.4.2 lib/app/models/part_object.rb
activeadmin-magicfields-0.4.1 lib/app/models/part_object.rb
activeadmin-magicfields-0.4.0 lib/app/models/part_object.rb