One is ratty when the room’s in a bad state (6)
I believe the answer is:
rodent
'one is ratty' is the definition.
(thesaurus)
'the room's in a bad state' is the wordplay.
'the room' becomes 'den' (den is a kind of room).
'in' is an insertion indicator.
'a bad state' becomes 'rot' (rot is a kind of state. I am not sure about the 'bad' bit.).
'den' put within 'rot' is 'RODENT'.
'when' is the link.
Can you help me to learn more?
(Other definitions for rodent that I've seen before include "Creature such as a rat" , "Nibbler" , "A rat, for instance" , "Mouse or squirrel, say" , "Animal such as a mouse" .)