Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quering on a model with translated attributes #49

Open
phlegx opened this issue Mar 10, 2011 · 1 comment
Open

Quering on a model with translated attributes #49

phlegx opened this issue Mar 10, 2011 · 1 comment

Comments

@phlegx
Copy link

phlegx commented Mar 10, 2011

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

@tomash
Copy link

tomash commented Mar 10, 2011

I wrote a reply in globalize3 issue you've created:
https://github.com/svenfuchs/globalize3/issues#issue/34

with rails2 of course change .where to :conditions => {'table.field' => name}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants