-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE ember-metal-is-present] Add Ember.isPresent #5136
Conversation
this is a new feature, it must follow those guidelines: see http://emberjs.com/guides/configuring-ember/feature-flags/ |
A value is present if it not `isBlank`. | ||
|
||
```javascript | ||
Ember.isPresent(); // false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no test case for this scenario ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pangratz Thanks, I've added a test.
@stefanpenner Sorry about that. I looked through CONTRIBUTING.md but not http://emberjs.com/guides/contributing/adding-new-features/. Is guarding the import and |
@amiel ya, someone should add that to contributing.MD as well (mind doing it?) |
@amiel - Would also be nice to have the commit prefixes in there (see #5135 (comment))... |
Please see #5137 |
hmmm, it looks like this failed at |
It looks like the failure now is in defeaturify; am I doing something wrong with the feature flags? |
@@ -9,6 +9,7 @@ | |||
"ember-routing-will-change-hooks": null, | |||
"ember-routing-consistent-resources": true, | |||
"event-dispatcher-can-disable-event-manager": null | |||
"ember-metal-is-present": null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing commas are not valid JSON.
@rjackson thanks. it looks like I had a couple of other feature flag issues as well (I didn't know |
LGTM! |
@amiel - Can you add an entry to Other than that 👍. |
Add Ember.isPresent as inverse of Ember.isBlank
Ok, done :) |
[FEATURE ember-metal-is-present] Add Ember.isPresent
Maybe it's because I come from rails, but I miss having
.present?
as the inverse of.blank?
. I find that I end up using! Ember.isBlank()
more thanEmber.isBlank()
by itself. I know this is a simple change, but I think the concept of presence is useful and more semantic. I first thought of this when working on jamesarosen/ember-cpm#36, and keep on finding times where it would make my code easier to understand.