April 2009

One ActiveRecord Model Acting as a List and Tree

Posted by Michael on April 30, 2009 in Programming, Ruby Language

Occasionally, Rails can appear to make your life extremely easy while silently throwing you a curve-ball. I needed a model that required a hierarchy while also preserving order of the records. Although fairly straightforward to set up and start immediately using, there are a couple of “gotchas” to watch out for and this [...]