lib/introspective_grape/traversal.rb in introspective_grape-0.2.7 vs lib/introspective_grape/traversal.rb in introspective_grape-0.2.8

- old
+ new

@@ -31,10 +31,10 @@ def find_leaf(routes, record, params) return record unless routes.size > 1 # For deeply nested routes we need to search from the root of the API to the leaf # of its nested associations in order to guarantee the validity of the relationship, - # the authorization on the parent model, and the sanity of passed parameters. + # the authorization on the parent model, and the sanity of passed parameters. routes[1..-1].each_with_index do |r| if record && params[r.key] ref = r.reflection record = record.send(ref.name).where( id: params[r.key] ).first if ref end