class method ActiveRecord.Model.belongsTo
ActiveRecord.Model.belongsTo(related_model_name[,options]) → null
Sepcifies a 1<-1 relationship between models. The foreign key will reside in the declaring object. - related_model_name (String): Can be a plural or singular referring to the related table, the model name, or a reference to the model itself ("users","User" or User would all work). - options (Object)
Options can contain:
- foreignKey (String)
- name (String)
- counter (String)
Comment.belongsTo('User',{
counter: 'comment_count' //comment count must be a column in User
});
var c = Comment.find(5);
//each Comment instance will gain the following 3 methods
c.getUser()
c.buildUser()
c.createUser()


