Skip to content

Instantly share code, notes, and snippets.

@constantm
constantm / application.controller.js
Last active October 12, 2015 10:56
ember map cli test not working
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
coords: ["-26.2041028", "28.0473051"]
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@constantm
constantm / application.controller.js
Last active September 13, 2015 11:27
opportunity-select
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@constantm
constantm / gist:0aa3d8398e72e4f5e7fe
Created August 21, 2015 14:18
Check whether paperclip attachment is exists in callback
In our app, we need to work out user profile completeness when a profile is saved. This is done via a callback. In this callback, we also check for the existance of Paperclip attachments.
This should supposedly be done with the following:
`@user.document.exists?`
That, however, returns false in the callback while a file is being uploaded. It looks like it's stuck in limbo between deleting the old file and saving the new one. A solution to this is to simply use the following:
`@user.document?`