matthuhiggins/foreigner — pull request #133 by markprzepiora (2014-02-07 05:40:46+00:00)
Title: Add support for add_foreign_key on multiple columns

This pull request allows you to add a foreign key on multiple columns using the `add_foreign_key` method. Simply specify the `column` and `primary_key` options as arrays of strings instead of strings.

For example, in order to enforce that only users with access to a project can create issues for it:

```ruby
create_table :issues do |t|
t.references :user
t.references :project
end

add_foreign_key :issues, :project_access,
column: %w(user_id project_id),
primary_key: %w(user_id project_id)
```