goncalossilva/rails3_acts_as_paranoid — pull request #105 by taelor (2013-03-08 05:35:41+00:00)
Title: fixing belongs_to :meta_thing, :dependent => destroy, polymorphic => true

Instead of trying to constantize the name of the relationship (i.e. meta_thing) by calling reflection.klass (and possibly getting a bug for unknown class Parent::MetaThing), we can look to the reflection's foreign_type on polymorphic associations, and constantize that to use for determining the scope when recovering and destroying deleted_at objects.

All the tests passed, and it helped fix our use case for this gem.