Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.
This repository was archived by the owner on Mar 30, 2022. It is now read-only.

ActiveRecord default where no longer works #75

@dnagir

Description

@dnagir

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:

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions