Skip to content

Commit

Permalink
Fix clone
Browse files Browse the repository at this point in the history
  • Loading branch information
1602 committed Mar 27, 2013
1 parent 8311bdb commit eafa6f6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/railway_routes.js
Expand Up @@ -50,13 +50,15 @@ function RoutesCollection(origin, prefix) {
var self = this;
if (origin) {
for (var name in origin) {
this[name] = function() {
var args = Array.prototype.slice.call(arguments);
return '/' + prefix + origin[name].apply(origin, args);
};
this[name].toString = function() {
return self[name]();
};
(function(name) {
self[name] = function() {
var args = Array.prototype.slice.call(arguments);
return prefix + origin[name].apply(origin, args);
};
self[name].toString = function() {
return self[name]();
};
})(name);
}
}
}
Expand Down

1 comment on commit eafa6f6

@tomaash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should fix the test as well.. Or maybe I can do it..

Please sign in to comment.