There seems to be a widespread belief that rats only eat cooked foods, meat, & fish I don't know where it originated. I have always composted all of them without any problems the only time I see rats is when the river floods & they have to move out of their burrows they get a fork or spade through them & the corpses are added to the compost heap as well. The only times I have had rats in the compost heaps it has been intentional.
The reason most people worry about rats is that they associate them with Weils disease. However only 15-30% of rats are likely to be carriers of Weils Disease the bacteria can only survive in water, and infection occurs when contaminated water enters the body either by swallowing or via an open wound. Once rat urine has dried, infection is unlikely. Leptospirosis, the early stages of the disease, is very rare and its deterioration into Weil’s disease rarer still. Fatalities only usually occur after mis-diagnosis. The number of human cases of Weil’s disease has fallen to particularly low levels in recent years. Temperatures below 4°C and above 37C° will kill the leptospira bacteria.
They can also be carriers of salmonellosis, typhus & pasteurella pestis but these are nothing to worry about either as the chances of infection through your compost heap are minimal.
It is impossible to make your compost bin 100% rat proof, although you can deter rats by lining any access points (ie: the base, sides and top of the bin) with a heavy-duty metal mesh. The mesh holes should be less than 1.5cm in diameter. Chicken wire is not suitable as they will chew straight through it. The most effective mesh is the type used by builders to reinforce concrete. My own bins are not lined with mesh as there has never been a need.
Rats are shy creatures and prefer to be undisturbed. Regular turning of the compost is likely to cause too much disruption for a rat colony to develop.
If people feel it is necessary to use poison to control the rats the corpses can still be added to the heap. The most commonly used poisons will break down during the composting process & it would take an awful lot of rat poison to build up to toxic levels in any case.