thoughtbot/shoulda-matchers — pull request #366 by planas (2013-10-09 23:36:25+00:00)
Title: Fix issue #203

Okay so that's the best approach I found for the long-living issue #203. It's based on https://github.com/TeaMoe/shoulda-matchers/commit/7667cb8ed5ece65d278dd9d662c15aaeda04241d but instead of looking for an existing model, it just symlinks the previous model with a new name.

There's one related caveat that still remains, since there's no way to be sure that an attribute contains a model name (well, it could be guessed with something like ```attr_name =~ /_type$/```, but is still a a rule of thumb), it's necessary to create a valid record before the validation happen, just like when using not-null constraints on the DB side. This is out of scope of this fix, but it should be probably documented.