mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 20:16:39 -04:00
20 lines
No EOL
422 B
JavaScript
20 lines
No EOL
422 B
JavaScript
/**
|
|
* Add an additional field to a schema.
|
|
* @param {Object} field
|
|
*/
|
|
Meteor.Collection.prototype.registerField = function (field) {
|
|
|
|
var collection = this;
|
|
var fieldSchema = {};
|
|
|
|
fieldSchema[field.propertyName] = field.propertySchema;
|
|
|
|
// add field schema to collection schema
|
|
collection.attachSchema(fieldSchema);
|
|
}
|
|
|
|
/**
|
|
* Global schemas object
|
|
* @namespace Telescope.schemas
|
|
*/
|
|
Telescope.schemas = {}; |