I have a table called routes within my database where each route has an origin and destination. Given any origin, I want to be able to return a list of destinations that can be reached directly from this origin OR from any destination that links with this origin. How can I do this in Ruby?
def find_available_routes(origin)
routes = Array.new
#each row in routes has 'origin' and 'destination'
end