MCPcopy Index your code
hub / github.com/codecombat/codecombat / validate

Method validate

app/models/CocoModel.js:196–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194 }
195
196 validate () {
197 const errors = this.getValidationErrors()
198 if (errors != null ? errors.length : undefined) {
199 if (!(typeof application !== 'undefined' && application !== null ? application.testing : undefined)) {
200 console.debug(`Validation failed for ${this.constructor.className}: '${this.get('name') || this}'.`)
201 for (const error of Array.from(errors)) {
202 console.debug('\t', error.dataPath, ':', error.message)
203 }
204 if (typeof console.trace === 'function') {
205 console.trace('cm err', errors)
206 }
207 }
208 return errors
209 }
210 }
211
212 save (attrs, options) {
213 if (options == null) { options = {} }

Callers

nothing calls this directly

Calls 2

getValidationErrorsMethod · 0.95
getMethod · 0.95

Tested by

no test coverage detected