Skip to content

Commit

Permalink
Make sure appendFormat is always
Browse files Browse the repository at this point in the history
When calling resources(name,actions) (so skipping the params parameter which seems to be supported), appendFormat is not set.
It should be done after the test on params for a function.
  • Loading branch information
jfremy committed Nov 25, 2012
1 parent ad9c84d commit b7e48d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/railway_routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,14 @@ Map.prototype.resources = function (name, params, actions) {
var self = this;
// params are optional
params = params || {};
params.appendFormat = ('appendFormat' in params) ? params.appendFormat : true;

// if params arg omitted, second arg may be `actions`
if (typeof params == 'function') {
actions = params;
params = {};
}

params.appendFormat = ('appendFormat' in params) ? params.appendFormat : true;

// If resource uses the path param, it's subroutes should be
// prefixed by path, not the resource's name
Expand Down

0 comments on commit b7e48d6

Please sign in to comment.