change find_last_by_ to where(...).last