Sha256: 43e9e650eb94d28d72ec3599ef794b269e528a42623a5a9a0ef473ad4fa56f1a

Contents?: true

Size: 752 Bytes

Versions: 16

Compression:

Stored size: 752 Bytes

Contents

const mongoose = require('mongoose/browser');

const [Number, String] = [
  mongoose.Schema.Types.Number,
  mongoose.Schema.Types.String,
];

const IdentifierSchema = mongoose.Schema({
  <%- for attribute in attrs_with_extras -%>
  <% if attribute[:default] %><%= attribute[:name] %>: { type: <%= TYPE_LOOKUP_JS[attribute[:type]] -%>, default: '<%= attribute[:default] %>' },<% else %><%= attribute[:name] %>: <%= TYPE_LOOKUP_JS[attribute[:type]] -%>,<%- end %>
  <%- end %>
}, { _id: false, id: false });

module.exports.IdentifierSchema = IdentifierSchema;
class Identifier extends mongoose.Document {
  constructor(object) {
    super(object, IdentifierSchema);
    this._type = 'QDM::<%= datatype %>';
  }
}
module.exports.Identifier = Identifier;

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
cqm-models-4.2.0 templates/identifier_template.js.erb
cqm-models-3.1.2 templates/identifier_template.js.erb
cqm-models-4.1.1 templates/identifier_template.js.erb
cqm-models-4.1.0 templates/identifier_template.js.erb
cqm-models-4.0.2 templates/identifier_template.js.erb
cqm-models-4.0.1 templates/identifier_template.js.erb
cqm-models-4.0.0 templates/identifier_template.js.erb
cqm-models-3.1.1 templates/identifier_template.js.erb
cqm-models-3.1.0 templates/identifier_template.js.erb
cqm-models-3.0.6 templates/identifier_template.js.erb
cqm-models-3.0.5 templates/identifier_template.js.erb
cqm-models-3.0.4 templates/identifier_template.js.erb
cqm-models-3.0.3 templates/identifier_template.js.erb
cqm-models-3.0.2 templates/identifier_template.js.erb
cqm-models-3.0.1 templates/identifier_template.js.erb
cqm-models-3.0.0 templates/identifier_template.js.erb