Skip to content

Instantly share code, notes, and snippets.

@mathie
Created April 22, 2016 05:33
Show Gist options
  • Save mathie/8c2c1e9b892bf4d1e97080627736fa18 to your computer and use it in GitHub Desktop.
Save mathie/8c2c1e9b892bf4d1e97080627736fa18 to your computer and use it in GitHub Desktop.
class Node < ActiveRecord::Base
def children
self.class.where(path: path + [id])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment