>1 has_many between two tables

I want an object 'a' with two members x and y where both are collections of type class B - thus my table for B contains two types of row.

Is this a sensible implementation?

class A   has_many :type_1                     :class => "B"                     :foreign_key => "a_id"                     :conditions "where type=1"   has_many :type_2                     :class => "B"                     :foreign_key => "a_id"                     :condition "where type=2"

If you want list like behavior for your x and y array then have to use acts_as_list declaration. Without knowing your application requirements, it is difficult to suggest anything.

The option for class name should be: :class_name. Except for that, it looks fine. You may also want to specify the :dependent attribute.