I am trying to use the fourth normal form for my applications so that i
can get the information in the appropriate language.
I have a table called manufacturers. I have another called descriptions.
The descriptions are in two languages and each description belongs to a
particular language. So two records in the Descriptions table one in
English and One in French for each manufacturer. The descriptions table
has the manufactturers id as a foreign key.
I have followed this for my Rails project but am stuck.
I have two models.
One is called Manufacturer.
One is called Description.
Manufacturer
has_many :descriptions
Description
belongs_to :manufacturer
In the manufacturers model I have the following method to look up all of
the manufacturers for the given locale.
def self.find_all
find(:all, :order => "name", :conditions => {:locale => I18n.locale})
end
This produces the following error
Mysql::Error: Unknown 'manufacturers.locale' in 'where clause': SELECT *
FROM 'manufacturers' where ('manufacturers'.'locale' = 'en')
how can I fix the sql statement in Rails?
Thank you in advance
Last edited by mitch_newbie (Today 07:24:24)
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---