Fix Resource#valid_attribute? for ruby 1.8