-
Notifications
You must be signed in to change notification settings - Fork 629
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
Namespaced scopes perform incorrect queries #822
Comments
I think the fix here would be for conditions = { aasm(state_machine_name).attribute_name => state_name.to_s }
class_eval do
scope scope_name, lambda { where(table_name => conditions) }
end Instead of this: conditions = { aasm(state_machine_name).attribute_name => scope_name.to_s }
class_eval do
scope scope_name, lambda { where(table_name => conditions) }
end |
See PR #823 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Namespaced scopes were implemented in #735. They do not work the way I expect.
To Reproduce
Add the following to the spec for namespaced scopes:
The spec will fail, because the non-namespaced query is:
While the namespaced query is:
Expected behavior
The namespaced query should not be testing a different status value. I do not expect the status values stored in the database to be namespaced.
The text was updated successfully, but these errors were encountered: