Re: Composite Key

Bill Lazar
Fri, 14 Oct 2005 18:29:06 -0000

Háber János <boci@...> writes:
> Bill Lazar írta:
> >Háber János <boci <at> ...> writes:
> >
> >>I want to create  a multi language table because
> >>AR not support composite primary keys... Now I have 2 table words
with one
> >>column (id) and localized_word with lang_id, word_id ant the
localized text.
> >
> >Probably "Using Gettext To Translate Your Rails Application"
is a
> >good place to look for the Rails-normal way of handling this common
issue.
> >
> That''s ok, but I want to allow the user modify/add the words. The
words
> table id is a many table foreign key. Example I have a property table
> where the user can add new propertyes , these properties is
> multilangual. So that''s the reason why I can''t use
gettext. Ohh and user
> can add new languages for their page.

Fair enough. I would disagree with the need for a composite key, regardless of
RoR or implementation language, and still use just id as PK with indexes on the
fields you suggest make up the ''functional'' key. Just filter
at runtime based on
the user''s settings. Not sure why this bothers you though, so no hard
feelings
and perhaps I''m not the person to answer for your specific needs.