RE: [Rails] Foreign key question

I think ActiveRecord will expect this join condition to work:

  on members.id = invitation.member_id

Would that work on your data?

I think that in both of those association declarations, the :foreign_key argument names the field in the child table that should be linked to the pk of the parent (is that right?). So if you want member_id to be the pk of the members table, you need to add a primary_key declaration on your members class (in which case you should probably ditch the members.id field, as it's liable to cause confusion).

I'd either do that, or rename members.member_id to something like members.legacy_member_id. That would keep you clear of the rails conventions.