jaguar_orm icon indicating copy to clipboard operation
jaguar_orm copied to clipboard

feature request: polymorphic relationships

Open shrugs opened this issue 5 years ago • 1 comments

Any ideas for implementing polymorphic relationships?

In active record terms, it'd be expressed like

class Teacher
  has_one :schedule, as: :owner
end

class Student
  has_one :schedule, as: :owner
end

class Schedule
  belongs_to :owner, polymorphic: true
end

but unfortunately this relationship is particularly difficult to express at the moment.

shrugs avatar Jan 18 '19 21:01 shrugs

Could you please elaborate more?

tejainece avatar Jun 27 '19 21:06 tejainece