Skip to content

Instantly share code, notes, and snippets.

@simi
Created September 8, 2010 13:13
Show Gist options
  • Save simi/570113 to your computer and use it in GitHub Desktop.
Save simi/570113 to your computer and use it in GitHub Desktop.
def parent_keys
x = []
if not parent.nil?
x << parent.parent_keys
end
x.flatten + self.key.to_a
end
@stefanluptak
Copy link

def parent_keys
  (parent.nil? ? [] : parent.parent_keys) + [self.key]
end

@simi
Copy link
Author

simi commented Sep 8, 2010

frajer jsi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment