← Graph

Avoiding model duplication across engines

question 3 connections

Audience question: in the marketplace example with buyer and seller engines, how do you avoid duplicating models? Adrian: that's a problem for 'developers who like to build things' rather than ship — extract shared behavior into modules or concerns and include them in per-engine models, or pick a different architecture that fits your app. In Avo's case there are no engine-owned models at all: Avo eager-loads the host app and picks up descendants of ApplicationRecord from the object space.

answer_summary
Extract shared code into modules/concerns and include it across engines, or skip engine-owned models entirely (Avo hooks into host-app ApplicationRecord descendants instead).
question Avoiding model duplication across engines
about
Rails Engine concept
Question concerns sharing data across engines.
question Avoiding model duplication across engines
about
Avo tool
Adrian's answer references how Avo avoids the issue entirely.
question Avoiding model duplication across engines
asked_at
Asked during the Q&A of this talk.

Provenance

Read by
4 extractions