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

Unscoped starting context leads to unexpected SQL #4

Open
hlascelles opened this issue Jun 14, 2013 · 0 comments
Open

Unscoped starting context leads to unexpected SQL #4

hlascelles opened this issue Jun 14, 2013 · 0 comments

Comments

@hlascelles
Copy link

I understand that the intentional behaviour for scopeless initial conditions is: "if you call or on a condition-less scope, it will be ignored", but I would say that is unexpected.

Imagine a scope that is sometimes pre-filtered (by CanCan in our case) for customers, but unfiltered for internal users. We want to show customers their products, and also offers. Here is our one line controller action. CanCan has provided products.

products = products.or.offers

This works for customers, but internal users can only see offers, as the initial scope is unfiltered and therefore dropped. I'd say this was unexpected...?

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

No branches or pull requests

1 participant