I get the error Cannot eagerly load the polymorphic association :messageable_fromuser
online = Message.all.joins(:messageable_fromuser)
I tried
online = Message.all.includes(:messageable_fromuser)
But it doesn't include the joined table in the result. I see two queries in my log when using includes. I don't know why people recommend using includes to eager load. How is two queries going to join anything?
IN (1, 10)
(the actual numbers will differ). This part of the query fills the role of joining both tables. W3schools has a simple example of the IN operator. – Oberland