Fetching nested resouces doesn't work properly if using a scope in ability conditions #328

Closed
flop opened this Issue Apr 1, 2011 · 3 comments

Comments

Projects
None yet
2 participants
@flop
Contributor

flop commented Apr 1, 2011

Hi Ryan,
First, thanks for your work on this gem :)
I just stumble on a problem when fetching nested resources with a scope condition defined in my abilities.
For example, when i'm trying to access my secret articles through a category, i'm getting all my articles regardless of their category.
It seems that using the scope in abilities and the accessible_by are discarding the conditions of the association.
I don't know why yet but i'm looking fot the cause.
I just pushed a failing test : sylogix/cancan@81f00f9

Any ideas ?

Flo

@ryanb

This comment has been minimized.

Show comment Hide comment
@ryanb

ryanb Apr 1, 2011

Owner

Thanks for providing a failing test. It is very strange this hasn't been brought up before. I guess if a where clause is provided it doesn't carry over the association conditions. Time to research it.

Owner

ryanb commented Apr 1, 2011

Thanks for providing a failing test. It is very strange this hasn't been brought up before. I guess if a where clause is provided it doesn't carry over the association conditions. Time to research it.

@flop

This comment has been minimized.

Show comment Hide comment
@flop

flop Apr 1, 2011

Contributor

Just found a solution to this problem and sent you a pull request for : sylogix/cancan@a10243a

Contributor

flop commented Apr 1, 2011

Just found a solution to this problem and sent you a pull request for : sylogix/cancan@a10243a

@ryanb

This comment has been minimized.

Show comment Hide comment
@ryanb

ryanb Apr 1, 2011

Owner

Awesome, thanks. I'll get this pulled in soon.

Owner

ryanb commented Apr 1, 2011

Awesome, thanks. I'll get this pulled in soon.

@ryanb ryanb closed this Apr 1, 2011

jhuckabee pushed a commit to jhuckabee/cancan that referenced this issue Jun 22, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment