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

Fix computed properties for embedded hasMany relationships (fixes #191) #205

Closed
wants to merge 1 commit into from
Closed

Conversation

kyptin
Copy link

@kyptin kyptin commented Apr 18, 2012

This commit fixes Issue #191, where:

  • a model A hasMany model B's,
  • the model B objects are embedded in a model A object, and
  • model A has a computed property that depends on a property of the
    hasMany association.

In such a case, what should have been the IDs of the embedded model B
objects were actually the objects themselves, which was causing
problems.

This bug is fixed in this commit and covered by a new test.

This commit fixes an issue where:
- a model A `hasMany` model B's,
- the model B objects are embedded in a model A object, and
- model A has a computed property that depends on *a property of* the
  hasMany association.

In such a case, what should have been the IDs of the embedded model B
objects were actually the objects themselves, which was causing
problems.

This bug is fixed now and covered by a new test.
@xdissent
Copy link

xdissent commented May 2, 2012

This works for me. The test is nearly identical to mine that recently started failing. Also works for non-id primary keys.

@mixonic
Copy link
Sponsor Member

mixonic commented May 10, 2012

I prefer #218 where the embedded data is actually used, instead of just stripped out and re-fetched.

@mixonic
Copy link
Sponsor Member

mixonic commented May 10, 2012

Sorry, I mean the pull request of #248 - there are a few fixed for this floating around, I got them mixed up.

@wagenet
Copy link
Member

wagenet commented Jun 21, 2012

Whoops, I should have checked the open PRs first. I just committed a fix for this. Thanks though!

@wagenet wagenet closed this Jun 21, 2012
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