Skip to content
This repository
Browse code

improve serialization doc

  • Loading branch information...
commit e34a4014ad2bf1d52c934f06093d179f469c62ac 1 parent 93bcb0c
Oscar Del Ben authored April 25, 2012
9  activemodel/lib/active_model/serialization.rb
@@ -26,17 +26,18 @@ module ActiveModel
26 26
   #   person.serializable_hash   # => {"name"=>"Bob"}
27 27
   #
28 28
   # You need to declare an attributes hash which contains the attributes
29  
-  # you want to serialize. When called, serializable hash will use
  29
+  # you want to serialize. Attributes must be strings, not symbols.
  30
+  # When called, serializable hash will use
30 31
   # instance methods that match the name of the attributes hash's keys.
31 32
   # In order to override this behavior, take a look at the private
32  
-  # method read_attribute_for_serialization.
  33
+  # method ++read_attribute_for_serialization++.
33 34
   #
34 35
   # Most of the time though, you will want to include the JSON or XML
35 36
   # serializations. Both of these modules automatically include the
36  
-  # ActiveModel::Serialization module, so there is no need to explicitly
  37
+  # ++ActiveModel::Serialization++ module, so there is no need to explicitly
37 38
   # include it.
38 39
   #
39  
-  # So a minimal implementation including XML and JSON would be:
  40
+  # A minimal implementation including XML and JSON would be:
40 41
   #
41 42
   #   class Person
42 43
   #     include ActiveModel::Serializers::JSON

0 notes on commit e34a401

Please sign in to comment.
Something went wrong with that request. Please try again.