JoinAssociation#build_constraint takes klass as first argument

See https://github.com/rails/rails/commit/743b67508e2027e1d086142ccbec47a19fc943f6