var Reward = db.define('reward', {
description: { type: 'text'},
value: { type: 'money'}
},
{ autoSave: true, autoFetch: true, autoFetchLimit: 3 }
);
var RewardType = db.define('rewardtype', {
title: { type: 'text', size: 100}
},
{ autoSave: true }
);
Reward.hasOne('type', RewardType, {reverse: 'rewards' });
In this example Reward has one to many relationships with RewardType when cache is left default (true) Reward.get(...) returns undefined for property "type" while type_id has a value.
When setting cache: false to both models, the 'type' property gets populated as expected using autofetch.
Is this a bug or is it normal behaviour? Spend hours trying to figure why autoFetch wasn't working...
In this example Reward has one to many relationships with RewardType when cache is left default (true) Reward.get(...) returns undefined for property "type" while type_id has a value.
When setting cache: false to both models, the 'type' property gets populated as expected using autofetch.
Is this a bug or is it normal behaviour? Spend hours trying to figure why autoFetch wasn't working...