Thanks Ben, but I don't believe so. As I said in the OP, the table is
'de-normalized'. I don't have 1 record per worker and project to be
able to associate the tables the usual way. I have many fields holding
project code values in the same record, obviously all of them with
different names. In other words, I have many fields to "hook into" for
the association to happen, not just one neat field I can associate
with.

On Feb 23, 2:40 pm, ben wiseley <[email protected]> wrote:
> you need 
> has_and_belongs_to_manyhttp://railsbrain.com/api/rails-2.3.2/doc/index.html?a=M001888&name=h...
>
> On Tue, Feb 23, 2010 at 11:32 AM, pepe <[email protected]> wrote:
> > Hi,
>
> > Working with legacy DB here...
>
> > 2 tables:
> >  Projects
> >  Workers
>
> > A worker record has many fields in it to hold project codes as in:
> > project1, project2, project3, ... project30 (great, isn't it?...)
>
> > Normalizing the DB is out of the question.
>
> > I've been thinking about this for a while and I can't find a way to
> > associate both tables as in:
>
> > "Project has_many :workers"
> > "Worker.project1 belongs_to :project"
> > "Worker.project2 belongs_to :project"
> > etc.
>
> > Any ideas?
>
> > Pepe
>
> > --
> > 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]<rubyonrails-talk%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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.

Reply via email to