Fix the class filter of the belongs_to relationship