diff --git a/DESIGN.textile b/DESIGN.textile index e05d9185..336d85d9 100644 --- a/DESIGN.textile +++ b/DESIGN.textile @@ -217,7 +217,7 @@ First, we specified the list of included attributes at the top of the class. Thi NOTE: Internally, +ActiveModel::Serializer+ uses +read_attribute_for_serialization+, which defaults to +read_attribute+, which defaults to +send+. So if you're rolling your own models for use with the serializer, you can use simple Ruby accessors for your attributes if you like. -Next, we use the attributes methood in our +serializable_hash+ method, which allowed us to eliminate the +post+ method we hand-rolled +Next, we use the attributes method in our +serializable_hash+ method, which allowed us to eliminate the +post+ method we hand-rolled earlier. We could also eliminate the +as_json+ method, as +ActiveModel::Serializer+ provides a default +as_json+ method for us that calls our +serializable_hash+ method and inserts a root. But we can go a step further! @@ -354,7 +354,7 @@ h4. Modifying Associations You can also rename associations if required. Say for example you have an association that makes sense to be named one thing in your code, but another when data is serialized. You can use the option to specify a different name for an association. -Here is an exmaple: +Here is an example:
 class UserSerializer < ActiveModel::Serializer
diff --git a/lib/active_model/array_serializer.rb b/lib/active_model/array_serializer.rb
index 4560a362..8c6106bd 100644
--- a/lib/active_model/array_serializer.rb
+++ b/lib/active_model/array_serializer.rb
@@ -23,7 +23,7 @@ module ActiveModel
     class_attribute :perform_caching
 
     class << self
-      # set peform caching like root
+      # set perform caching like root
       def cached(value = true)
         self.perform_caching = value
       end