DEV Community

Discussion on: How would you setup a model in Rails to reference the same model type?

Collapse
 
spenser profile image
Spenser • Edited

I'd question whether a method like this should sit in the model (should it actually have knowledge of its sibling persisted objects? Usually not)

Depending on your context, making a small class/service/whatever which determines position might be more suitable (and easier to test/maintain).