1, add polymorphic check for the has_one association

Hi,

  I read (the post)[http://robots.thoughtbot.com/post/55689359336/the-perils-of-uniqueness-validations] this morning, and I think we should have compound unique index for polymorphic has_one association, here's my pull request, please help to review and merge, thanks a lot