You should never have a 'where' caluse in a controller. There should all be methods on the models.