Handle correctly null associations

null belongs_to associations are now serialized as nil instead
of raise an error during serialization.
Merge pull request #708 from ride/fix-for-nil-associations

Handle correctly null associations