Skip to content

Instantly share code, notes, and snippets.

View CodeOfficer's full-sized avatar

Russell Jones CodeOfficer

View GitHub Profile
var get = Ember.get;
DS.Model.reopen({
validate: function() {
if (get(this, 'isDeleted')) {
return;
}
get(this, 'validators').forEach(function(validator) {
validator.fn.call(this, validator.meta.key(this.constructor), get(this, validator.attribute), validator.options);
}, this);
@CodeOfficer
CodeOfficer / validators.js
Created January 17, 2013 16:02
Validators for ember-data
var get = Ember.get;
DS.Model.reopen({
validate: function() {
if (get(this, 'isDeleted')) {
return;
}
get(this, 'validators').forEach(function(validator) {
validator.fn.call(this, validator.meta.key(this.constructor), get(this, validator.attribute), validator.options);
}, this);
@CodeOfficer
CodeOfficer / firestore.rules
Created September 1, 2021 16:08 — forked from pfiadDi/firestore.rules
Firestore Advanced Security Rules
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
function isAuthenticated() {
return request.auth != null;
}
function isDefined(field) {
return field in request.resource.data