This project is archived and is in readonly mode.
Find conditions get clobbered by nested scopes
-
Matt Hanlon
As background, I came across this issue while upgrading a 2.1 rails app that uses nested find scopes to implement some user access control. Basically it uses named scopes like
Asset.filter_by_user_access(some_user).filter_by_search_terms(some_term)In this case, the search scope clobbered the access scope since they both relied on some of the same fields.
-
Joe Goldberg
I'm having this problem too. How can we get http://github.com/lifo to see this ticket so he can comment on the change?
-
Matt Hanlon
- Tag set to 2.3.2, activerecord, condition, find, named_scope, s
-
Matt Hanlon
- Tag changed from 2.3.2, activerecord, condition, find, named_scope, s to 2.3.2, activerecord, condition, find, named_scope
-
Rohit Arondekar
- State changed from new to stale
- Importance changed from to
Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.
-
Henning
This issue seems to be fixed in Rails 3.0.5, but it is still a problem with older version of Rails 3 and every version of Rails 2. A long writeup on the issue can be found here: http://makandra.com/notes/740-know-the-side-effects-of-using-hashes...
This should be fixed for Rails 2 because every application that uses scopes to restrict user access might be broken.
I could provide a patch that fixes this for the
2-3-stablebranch. Given that Rails 3 is the hot new thing now, would my fix still be considered for a future release?