Skip to content

Instantly share code, notes, and snippets.

@cjse
Created August 28, 2008 14:15
Show Gist options
  • Save cjse/7728 to your computer and use it in GitHub Desktop.
Save cjse/7728 to your computer and use it in GitHub Desktop.
def has_children?
self.class.reflect_on_all_associations(:has_many).map { |a| !send(a.name).empty? }.any?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment