Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[refactor] removed dead getChild code

  • Loading branch information...
commit 93b9fabb3bf19139d48dd7d61119e436295a7f79 1 parent e483234
@nrw nrw authored
Showing with 5 additions and 15 deletions.
  1. +5 −15 lib/resourceful/resource.js
View
20 lib/resourceful/resource.js
@@ -547,26 +547,16 @@ function relationship(factory, type, r, options) {
// Parent.getChild(parent, child_id, callback)
//
factory['get' + rstringc] = function (parent, child_id, callback) {
- var key = factory.lowerResource + '_id',
- id = parent.key || parent,
+ var id = parent.key || parent,
cid = child_id;
- factory.get(id, function(err, p) {
+ id_path = factory.lowerResource + '/' + id + '/' + cid
+
+ rfactory.get(id_path, function(err, child){
if(err) {
if(callback) return callback(err);
}
-
- var rstringi = rstring + '_ids';
- p[rstringi] = p[rstringi] || [];
-
- id_path = factory.lowerResource + '/' + id + '/' + cid
-
- rfactory.get(id_path, function(err, child){
- if(err) {
- if(callback) return callback(err);
- }
- return callback(null, child);
- });
+ return callback(null, child);
});
}
//
Please sign in to comment.
Something went wrong with that request. Please try again.