Skip to content

Quering on a model with translated attributes #49

Description

@phlegx

Hi!

How can I query a model where an attribute is translated with globalize2. I have for example this line, and the attribute name is in the country_translations table:

I18n.locale = :de
@countries = Country.scoped
@countries.where(:name => '[Some country name]')

This gives me an error: ActiveRecord::StatementInvalid (No attribute named name exists for table countries): ...

Thx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions