MotionModel
MotionModel copied to clipboard
Polymorphic columns do not work
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.
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?