I created model Pattern.js, looks this way:
var Pattern = {
adapter: 'land',
attributes: {
name: 'STRING',
code: 'STRING'
}
};
module.exports = Pattern;
And now I have two problems:
- I can't get access from my HomeController to this model. I tried to require it, but code fails. How to get access to the models from other files?
- There is no method 'create' in the documentation, so what is the way to create new record using a defined model?