ok, I’ve got a model called Location, the idea being that i have a
bunch of locations aligned to a grid. Each location has a pointer to
it’s neighbors, like so
ok, I’ve got a model called Location, the idea being that i have a
bunch of locations aligned to a grid. Each location has a pointer to
it’s neighbors, like so
Is there a reason why you would avoid setting up an association for
each one? It seems like it’s basically the exact same thing you
proposed, but a little more long-winded. No offense meant
I mean what difference does it make if I create an association that
finds its neighbors vs. writing a method that ends up finding the
neighbors manually?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.