Supporting tables with Compound Keys

RoR nuby

Ok, I know that RoR < ActiveRecord doesn't support Compound Keys out of the box.

I figured I would have to manually code a number of methods to override the default :id support.

Source:

class ContractCoverages < ActiveRecord::Base

  set_table_name "contract_coverages"   set_primary_key "contract_id, coverage_id"

end

I was thinking - find -update -new

What's weird is I can't find any examples. Anybody got some suggestions?

Thanks, Jason

Steve,

Thank you. I'd see Dr. Nic's stuff, but I hadn't noticed the CompositeKey plugin.

I'm on it.

Thanks, Jason