Serialized methods that return nil should not be considered YAML #492

merged 1 commit into from May 10, 2011


None yet

2 participants

jaw6 commented May 10, 2011

(Rebased version of #200 (commits))

The way ActiveModel computes the type of serializable methods and attributes, any that return nil will be described as being YAML.

This produces XML like:

  <name>John Doe</name>
  <preferences type="yaml" nil="true"></preferences>

However, in many cases, the 'type="yaml"' part is unnecessary, and potentially misleading.

With this patch, the equivalent to the above XML would be:

  <name>John Doe</name>
  <preferences nil="true"></preferences>
@josevalim josevalim merged commit ceaf73a into rails:master May 10, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment