ActiveRecord with a weird DB Schema

Hi everyone,

I'm having a bit of difficulty wrapping my head around this schema. Basically there are no 'normal' foreign key. It's all text...

PACKAGES

Keys can be varchar.

What might make your brain hurt less is using views on those tables
with the rails naming conventions. If, of course, your SQL variant
supports views.