Directed Acyclic Graph hierarchy for Rail's ActiveRecord models