Last active
March 3, 2016 04:31
-
-
Save offirgolan/7901cedff688320020ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import User from '../models/user'; | |
const Validations_1 = buildValidations({ | |
username: validator('presence') | |
}) | |
export default Ember.Component.extend({ | |
init() { | |
this.super(...arguments); | |
this.set('model', User.extend(Validations_1).create()); | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import User from '../models/user'; | |
const Validations_2 = buildValidations({ | |
username: validator('length', {min: 5}) | |
}) | |
export default Ember.Component.extend({ | |
init() { | |
this.super(...arguments); | |
this.set('model', User.extend(Validations_2).create()); | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Validations = buildValidations({ | |
password: validator('presence') | |
}) | |
export default DS.Model.extend(Validations, { | |
// ... | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment