Closed pehrlich closed 12 years ago
Contrary to the docs, I appear to have to declare specifically columns for relationships http://spinejs.com/docs/relations
class window.Post extends Spine.Model @configure 'Post', 'body' @belongsTo 'goal', 'Goal' p = Goal.first().posts().create({body: 'asd'}) p.body # 'asd' p.goal_id # undefined (as well as goal()) class window.Post extends Spine.Model @configure 'Post', 'body', 'goal_id' @belongsTo 'goal', 'Goal' p = Goal.first().posts().create({body: 'asd'}) p.goal_id # 17 p.goal() @ goal
Have a look at the Models attributes - goal_id should be in there. This looks like a separate issue.
Contrary to the docs, I appear to have to declare specifically columns for relationships http://spinejs.com/docs/relations