ernie/squeel — Issue #75: ActiveRecord default where no longer works
Author: dnagir
Created: 2011-11-08 04:51:05+00:00
State: open

I have an existing Rails 3.1 app with complex scopes that use simple hash conditions like `Article.published `.

It worked before I added squeel. The problem is that its `.to_sql` started to generate incorrect SQL:

```sql
SELECT articles.* from articles.* WHERE articles.status = articles.approved
```

Not the WHERE clause and the `approved` column that doesn't exist. It was specified on the scope:

```ruby
Article.scope :published, where(:status => :approved)
```

I would prefer to keep existing AR queries and use squeel here and there.
Or maybe I'm just doing something wrong?

Also tried to `config.load_core_extensions :symbol`, but it only seems compatibility with MetaWhere.