rubyvideo
rubyvideo copied to clipboard
speakers association is defined twice in Talk model
We have two definition for the speakers association on the talk model
The first is the association
The second is the manual definition that supports meta talk
def speakers
return super unless meta_talk
super.to_a.union(child_talks.flat_map(&:speakers).uniq)
end
This causes 2 issues
- we cannot really eager load this association
- in Avo when we visit a meta talk it crashes as we return an array not an active record relation
It would be great if we could combine this into a real association