Want seralization to be an "opt-in" process so that only fields with a [DataMember] attribute show up in the xml.  

Looked at DataContractSerializerSettings, but doesn't seem to have anything.  Tried below for kicks and giggles, but the xml still contained properties that did not have the [DataMember] attribute...

  DataContractSerializer writer = 
    new DataContractSerializer( typeof( ProductAAnimals ), 
    new DataContractSerializerSettings()
    {
        IgnoreExtensionDataObject = true
    } );



Question: Brakeman: model attribute used in file name warnings
Answer: You could sanitize model attribute when generating file name

"abc_#{sanitize(@mymodel.some_attribute)}.pdf"


I think we could find even better solution if you post exact code example.