Use base_class when checking valid class type

The dynamically generated setter allowed assigning a specified class or its
direct descendant, but it did not allow for arbitrary depth descendants. By
using base_class we will always get the first ActiveRecord class.