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

pass correct object type to association reflection #992

Merged
merged 1 commit into from Jul 11, 2020
Merged

pass correct object type to association reflection #992

merged 1 commit into from Jul 11, 2020

Conversation

formigarafa
Copy link
Contributor

This is to make the association relation receive the expected parameter
(a AR instance, not its class). fix #952

@formigarafa
Copy link
Contributor Author

I wrote another test before but it was duplicating most of the previous code, so I removed it.
Now I have fixed it to only test the change. It should be better, now.

alyssais added a commit to alyssais/shoulda-matchers that referenced this pull request Mar 12, 2017
…lation

pass correct object type to association reflection
@mcmire mcmire added this to the v4.next milestone Feb 18, 2019
@mcmire mcmire modified the milestones: v4.next, v4.2.0 Jun 9, 2019
@guialbuk guialbuk modified the milestones: v4.2.0, v4.next Feb 18, 2020
It's currently not possible to test a `has_many` association that is
defined with a scope block where the block takes an instance of the
association source. The `have_many` matcher attempts to call this scope
and when it does so it does not pass that instance. This commit fixes
that.

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
@mcmire mcmire merged commit 421a49d into thoughtbot:master Jul 11, 2020
@mcmire
Copy link
Collaborator

mcmire commented Jul 11, 2020

Sorry for the delay in getting to this. I took the liberty of adding a missing test to this and cleaning up a couple things around the existing tests. This is merged now!

@formigarafa
Copy link
Contributor Author

@mcmire , I don't mind at all and I really appreciate that. Thanks.

@mcmire mcmire mentioned this pull request Jul 25, 2020
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.

Conditions qualifier, when association owner is part of the condition
4 participants