E
E
eldar_web2016-04-14 17:23:26
Ruby on Rails
eldar_web, 2016-04-14 17:23:26

How to recurse in Ruby?

There is a User table with fields id, manager_id, where id user-a is stored in manager_id.
The id is known, and I need to take all the id's in the hierarchy. Let's say there is a user with id = 5.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav German, 2016-05-13
@eldar_web

Use gem ancestry

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question