fix bug when joining in rails 3.2, make sure comparisons are fair and inheritance methods are passed to @klass