I learned the hard way that rats invaded my compost pile. I probably didn't turn it enough. I read an article from "David the Good" that solved it. He said to bury your material to be composted. We keep an empty plastic coffee can with lid under the kitchen sink and once it's full we take it out to where we want to garden. We dig a new hole each time. We now have two gardens to grow both winter and spring crops. And the worms have found them.