Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion models/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = function (Meta, options) {
*/
function formatProperties (properties) {
const result = {}
for (const key in properties) {
for (key in properties) {
if (properties.hasOwnProperty(key)) {
result[ key ] = _.clone(properties[ key ])
result[ key ].type = properties[ key ].type.name
Expand Down
9 changes: 9 additions & 0 deletions test/component-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ describe('Component test', function() {
expect(res.validations).to.be.an('array')
})
})

it('should find all models fields', function () {
return Meta.getModelById('Category')
.then((res) = > {
expect(res.properties).to.be.an('object')
expect(res.properties.name).to.be.an('object')
expect(res.properties.id).to.be.an('object')
})
})

})
})