freelancing-god/thinking-sphinx — Issue #333: Unscoped does not premempt default_scope when using search
Author: bullfight
Created: 2012-02-02 12:45:36+00:00
State: open

I am working on a model with a default_scope. In some search situations I would like to override that default_scope and search on the unscoped model.

As it stands if I try to search using a parameter that returns records that are scoped out I get nils whether I use unscoped or not

``` ruby

Article.search("parameter sometimes scoped out by default_scope")
=> [nil, nil, #

, nil, nil. nil]

# unscoped delivers exactly the same result
Article.unscoped.search("parameter sometimes scoped out by default_scope")
=> [nil, nil, #

, nil, nil. nil]

# while a where query might do the following
Article.where("title LIKE ?", "parameter")
=> []

Article.unscoped.where("title LIKE ?", "parameter")
=> [ #

, #

, #

, #

]
```