allow for custom primary key

This allows to use outer_joins() on a relation which specifies a custom primary key,for example: 
`has_many :product_classes, :foreign_key => :partnumber, :primary_key => :part_number`