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 initial polymorphic attribute #5366

Merged
merged 1 commit into from Apr 3, 2018
Merged

fix initial polymorphic attribute #5366

merged 1 commit into from Apr 3, 2018

Conversation

sly7-7
Copy link
Contributor

@sly7-7 sly7-7 commented Feb 28, 2018

Maybe I'm missing something, but it seems weird for a relationship to be polymorphic by default, right ?

sly7-7 referenced this pull request Feb 28, 2018
The goal here is to do as little work as we can with relationship payloads until
the relationship is actually accessed.  In an extreme case, where many
relationship payloads are pushed, but no relationships are accessed, all we want
to do is stash the payload.
@bmac
Copy link
Member

bmac commented Mar 8, 2018

@hjdivad would you have time to review this pr?

@bmac bmac requested a review from hjdivad March 8, 2018 16:21
@rwjblue
Copy link
Member

rwjblue commented Mar 28, 2018

Would you mind adding a regression test, to help ensure we don't make this mistake again...

Copy link
Contributor

@runspired runspired left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on the change but would like to see a regression test added

@sly7-7
Copy link
Contributor Author

sly7-7 commented Mar 29, 2018

The thing is I don't even know if this property is used at all. I think (maybe wrongly) if it was used, some existing tests would already be failing. I will investigate more asap.

@sly7-7
Copy link
Contributor Author

sly7-7 commented Apr 3, 2018

@runspired Ok, I also removed the initialization of the isPolymorphic attribute from the HasManyRelationship class. In that case, without the right initialization to 'false' in the parent class, some tests are failling.

@sly7-7
Copy link
Contributor Author

sly7-7 commented Apr 3, 2018

Also, I'm sorry, I've created this branch against the repo itself, not mine...

@runspired runspired merged commit 612ef6d into master Apr 3, 2018
@runspired runspired deleted the sly7-7-patch-1 branch April 3, 2018 08:52
@runspired
Copy link
Contributor

Thanks! so the TLDR for anyone following along was that our tests passed bc the extended class (has-many) also initialized isPolymorphic clobbering our mistake. By fixing the mistake we removed the dual initialization.

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.

None yet

4 participants