Last active
February 20, 2017 19:51
-
-
Save pswai/a469a2ba6b9f8c073817ec2e6a86a0d0 to your computer and use it in GitHub Desktop.
Ember-changeset incompatibility with Ember < 2.4.5
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 Ember from 'ember'; | |
import Changeset from 'ember-changeset'; | |
import { validatePresence } from 'ember-changeset-validations/validators'; | |
import lookupValidator from 'ember-changeset-validations'; | |
export default Ember.Controller.extend({ | |
init() { | |
this._super(...arguments); | |
const model = Ember.get(this, 'user'); | |
const validation = Ember.get(this, 'validation'); | |
this.changeset = new Changeset(model, lookupValidator(validation), validation); | |
}, | |
emberVersion: Ember.VERSION, | |
user: { | |
name: 'ClearMe' | |
}, | |
validation: { | |
name: validatePresence(true) | |
} | |
}); |
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 Ember from 'ember'; | |
export function json(params/*, hash*/) { | |
return JSON.stringify(params[0], null, 2); | |
} | |
export default Ember.Helper.helper(json); |
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
{ | |
"version": "0.11.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "1.13.13", | |
"ember-data": "2.11.0", | |
"ember-template-compiler": "1.13.13", | |
"ember-testing": "1.13.13" | |
}, | |
"addons": { | |
"ember-changeset": "1.2.0", | |
"ember-changeset-validations": "1.2.4" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment