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

Multiple in_region calls should not collide #11

Open
bdunne opened this issue Jan 29, 2019 · 9 comments
Open

Multiple in_region calls should not collide #11

bdunne opened this issue Jan 29, 2019 · 9 comments

Comments

@bdunne
Copy link
Member

bdunne commented Jan 29, 2019

If you do SomeModel.in_my_region.in_region(x)... you won't see any records.

Found this by setting default_scope { in_my_region } on a model. The workaround was to call .unscoped.in_region(x)...

@carbonin
Copy link
Member

SomeModel.in_my_region.in_region(x)

In this case are you in region "x" or not? And does that change whether you get records?

I would expect this behavior as long as it returns the correct rows when you're in region 1 and do SomeModel.in_my_region.in_region(1)

Otherwise I would say this is working as expected.

@bdunne
Copy link
Member Author

bdunne commented Jan 29, 2019

In this case are you in region "x" or not?

No, my_region and x are different numbers for this issue

@carbonin
Copy link
Member

I think this is not a bug then. That would be like saying:

Model.where(:thing => 1).where(:thing => 2) it doesn't really make sense.

@kbrock
Copy link
Member

kbrock commented Jan 30, 2019

So the issue is that there is a default_scope?

@bdunne
Copy link
Member Author

bdunne commented Jan 30, 2019

The issue is that I was using this in a model with a default scope of in_my_region, but on my call I was expecting Model.in_region(another_region_id) to override the default scope. Instead I had to call Model.unscoped.in_region(another_region_id).

@miq-bot
Copy link
Member

miq-bot commented Aug 5, 2019

This issue has been automatically marked as stale because it has not been updated for at least 6 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions!

@miq-bot miq-bot added the stale label Aug 5, 2019
@kbrock
Copy link
Member

kbrock commented Aug 7, 2019

@bdunne wonder if we could put unscoped(:region_id) into in_region or something

@bdunne bdunne removed the stale label Aug 7, 2019
@bdunne

This comment has been minimized.

@miq-bot
Copy link
Member

miq-bot commented Jun 11, 2020

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the traige process documentation.

@bdunne bdunne added pinned and removed stale labels Jun 15, 2020
@Fryguy Fryguy added the size/s label May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants