MotionModel icon indicating copy to clipboard operation
MotionModel copied to clipboard

Polymorphic columns do not work

Open wizardofosmium opened this issue 3 years ago • 1 comments

For a model such as

class Icon

  include MotionModel::Model
  include MotionModel::ArrayModelAdapter
  
  columns(
    name: :string
  )
  
  belongs_to :record, polymorphic: true
  
end

The following raises a classify exception:

widget = Widget.create
gadget = Gadget.create
icon = Icon.create

icon.record
icon.record = widget
icon.record
icon.record = gadget

because belongs_to_relation assumes you can always classify the column, but the column specifically raises an exception when trying to classify a polymorphic column.

wizardofosmium avatar Mar 23 '22 12:03 wizardofosmium

I just don’t know that we ever put much into polymorphic columns. I’ll be honest: I don’t even have a current RubyMotion license, so I would not be in a place to work on this. Would you be interested in moving this project forward?

sxross avatar Mar 24 '22 01:03 sxross