Polymorphic Association

Hi there,

I’m new to Ruby & co and I just played with Rails and trying to migrate a CSM to Hanami. As Hanami’s default is ROM, I was wondering if there is the polymorphic association in ROM? Why not?

In my naive view, other than polymorphic associations, it really makes little sense to not use plain SQL to CRUD data on a database. I mean, sure, it looks more ruby-like when writing, but at the end of the day, SQL isn’t that much a burden to have to translate it into another language!

Hey, welcome

There is some debate in the community about polymorphic associations if they are a pattern or an ati-pattern.

There is a issue on rom-sql about it https://github.com/rom-rb/rom-repository/issues/73 and some possible solutions there.

Hope this helps,

1 Like