created active record code to search for games