rubyvideo icon indicating copy to clipboard operation
rubyvideo copied to clipboard

speakers association is defined twice in Talk model

Open adrienpoly opened this issue 8 months ago • 0 comments

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

  1. we cannot really eager load this association
  2. 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

adrienpoly avatar Apr 22 '25 06:04 adrienpoly