Support foreign key creation rails4

This pull request fixes 3 failing tests around adding foreign keys under Rails 4.0.0.  It is based off of an earlier, still-open pull request by Yasuo Honda.