Skip to content

Instantly share code, notes, and snippets.

@libryder
Created November 9, 2011 21:55
Show Gist options
  • Save libryder/1353220 to your computer and use it in GitHub Desktop.
Save libryder/1353220 to your computer and use it in GitHub Desktop.
class OrganizationalUnit < ActiveRecord::Base
has_many :children, :class_name => "OrganizationalUnit", :foreign_key => :parent_id
def children?
children.present?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment