Skip to content
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

[BUGFIX Release] Special case {{#with}} for isTruthy #12922

Merged
merged 1 commit into from
Feb 7, 2016

Conversation

chadhietala
Copy link
Contributor

Should resepect isTruthy on objects.

Should resepect `isTruthy` on objects.
@rwjblue
Copy link
Member

rwjblue commented Feb 7, 2016

The failed tests were fixed in glimmerjs/glimmer-vm#71, I merged and restarted the build.

rwjblue added a commit that referenced this pull request Feb 7, 2016
[BUGFIX Release] Special case `{{#with}}` for `isTruthy`
@rwjblue rwjblue merged commit 9dd4db5 into emberjs:master Feb 7, 2016
@chadhietala chadhietala deleted the failing-isTruthy-test branch February 7, 2016 21:28
@rwjblue rwjblue mentioned this pull request Feb 7, 2016
@ilucin
Copy link
Contributor

ilucin commented Mar 2, 2016

I've upgraded to 2.4.1 and noticed that this commit broke something in my use case. I'm not completely sure if I'm doing something wrong here (I'm relatively new to Ember), so just wanted to check out with you guys @chadhietala @rwjblue

I'm doing this in my component:

{{#with invoice.deal as |deal|}} {{partial 'path/to/partial'}} {{/with}}

.. where invoice & deal are DS.Models and invoice belongsTo deal.

Now, because get('invoice.deal.isTruthy') => true (not sure why/where this property got set, I would guess it's because it is an async relation), params[0] of 'with' helper was transformed to true.
Of course, my partial expects for deal in the scope to be DS.Model and everything breaks.

If I do {{#with invoice.deal.content as |deal|}} everything works - but I think this is not a right solution to the problem (we don't want to be aware in our templates if the relation is async or not).

Anyways, something is wrong somewhere but I don't have enough experience to assume where. What do you think?

@rwjblue
Copy link
Member

rwjblue commented Mar 2, 2016

Hmm, there was a subsequent PR that ensured the right value was used in the block param, that pull request should have been included in 2.4.0/2.4.1 (though it is possible that I missed it when preparing for the release).

Can you open a new issue with a JSBin and/or ember-twiddle.com demo? You can create an object with an isTruthy method returning true and show that the wrong value is used as the block param (instead of setting up the whole ember-data model scenario in the demo).

@ilucin
Copy link
Contributor

ilucin commented Mar 2, 2016

@rwjblue Sure, no problem.

@jcbvm
Copy link

jcbvm commented Mar 3, 2016

Same problem here, created a JSBin.
http://emberjs.jsbin.com/vetezutapa/2/edit?html,js,output

@rwjblue
Copy link
Member

rwjblue commented Mar 3, 2016

@jcbvm - Same answer 😈

@jcbvm
Copy link

jcbvm commented Mar 3, 2016

Oh lol, created issue #13045

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants