Hi, i think i have an inflector problem, ''cause my "has_many through" association is failing like this: Mysql::Error: #42S22Unknown column ''prod_thicknesses_prod_codes_join.prod_thicknes_id'' in ''on clause'': SELECT count(DISTINCT prod_codes.id) AS count_all FROM prod_codes LEFT OUTER JOIN products ON (prod_codes.`id` = products.`prod_code_id`) LEFT OUTER JOIN prod_formats ON (prod_formats.`id` = products.`prod_format_id`) LEFT OUTER JOIN products prod_thicknesses_prod_codes_join ON (prod_codes.`id` = prod_thicknesses_prod_codes_join.`prod_code_id`) LEFT OUTER JOIN prod_thicknesses ON (prod_thicknesses.`id` prod_thicknesses_prod_codes_join.`prod_thicknes_id`) LEFT OUTER JOIN products products_prod_codes ON products_prod_codes.prod_code_id = prod_codes.id ----------------------- In the SQL clause, ''prod_thicknes_id'' should read like ''prod_thickness_id'' (extra ''s'' at the word''s end). I tried to manually inflect the correct behavior but nothing happens!: enviroment.rb: .... Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, ''\1en'' # inflect.singular /^(ox)en/i, ''\1'' # inflect.irregular ''person'', ''people'' inflect.irregular ''thickness'', ''thicknesses'' inflect.irregular ''prod_thickness'', ''prod_thicknesses'' end What should i do??? Thanks! -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
brabuhr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-19 22:21 UTC
Re: Inflector problem?
On 6/19/07, Emmanuel Oga <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, i think i have an inflector problem, ''cause my "has_many through" > association is failing like this: > > In the SQL clause, ''prod_thicknes_id'' should read like > ''prod_thickness_id'' (extra ''s'' at the word''s end). I tried to manually > inflect the correct behavior but nothing happens!: > > enviroment.rb: > .... > Inflector.inflections do |inflect| > # inflect.plural /^(ox)$/i, ''\1en'' > # inflect.singular /^(ox)en/i, ''\1'' > # inflect.irregular ''person'', ''people'' > inflect.irregular ''thickness'', ''thicknesses'' > inflect.irregular ''prod_thickness'', ''prod_thicknesses'' > end > > What should i do???First hackish thought: Inflector.inflections do |inflect| inflect.plural ''thickness'', ''thicknesses'' inflect.singular ''thickness'', ''thickness'' inflect.singular ''thicknesses'', ''thickness'' inflect.plural ''thicknesses'', ''thicknesses'' end --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---