Skip to content

Commit

Permalink
Pass index option to hasOne field
Browse files Browse the repository at this point in the history
  • Loading branch information
kapouer committed Mar 24, 2015
1 parent 1799e9d commit 6877c47
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Associations/One.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ exports.prepare = function (Model, associations) {
}
if (!association.reversed) {
Model.addProperty(
_.extend({}, association.field[k], { klass: 'hasOne' }),
_.extend({}, association.field[k], { klass: 'hasOne', index: association.index }),
false
);
}
Expand All @@ -72,7 +72,8 @@ exports.prepare = function (Model, associations) {
reverseAccessor: undefined,
field : association.field,
autoFetch : association.autoFetch,
autoFetchLimit : association.autoFetchLimit
autoFetchLimit : association.autoFetchLimit,
index: association.index
});
}

Expand Down

0 comments on commit 6877c47

Please sign in to comment.