From e67c28dfe00530ff1ce20f6a5982dcb96d505f01 Mon Sep 17 00:00:00 2001 From: Rizwan Reza Date: Mon, 14 Jun 2010 13:59:55 +0430 Subject: Added headings to serializers. --- activemodel/lib/active_model/locale/en.yml | 2 +- activemodel/lib/active_model/serializers/json.rb | 5 +++-- activemodel/lib/active_model/serializers/xml.rb | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/activemodel/lib/active_model/locale/en.yml b/activemodel/lib/active_model/locale/en.yml index 602a530dc0..44425b4a28 100644 --- a/activemodel/lib/active_model/locale/en.yml +++ b/activemodel/lib/active_model/locale/en.yml @@ -1,6 +1,6 @@ en: errors: - # The default format use in full error messages. + # The default format to use in full error messages. format: "%{attribute} %{message}" # The values :model, :attribute and :value are always available for interpolation diff --git a/activemodel/lib/active_model/serializers/json.rb b/activemodel/lib/active_model/serializers/json.rb index 90305978c4..918cd0ab76 100644 --- a/activemodel/lib/active_model/serializers/json.rb +++ b/activemodel/lib/active_model/serializers/json.rb @@ -2,6 +2,7 @@ require 'active_support/json' require 'active_support/core_ext/class/attribute' module ActiveModel + # == Active Model JSON Serializer module Serializers module JSON extend ActiveSupport::Concern @@ -14,8 +15,8 @@ module ActiveModel self.include_root_in_json = true end - # Returns a JSON string representing the model. Some configuration is - # available through +options+. + # Returns a JSON string representing the model. Some configuration can be + # passed through +options+. # # The option ActiveModel::Base.include_root_in_json controls the # top-level behavior of to_json. It is true by default. When it is true, diff --git a/activemodel/lib/active_model/serializers/xml.rb b/activemodel/lib/active_model/serializers/xml.rb index 934af2b8a8..ed64434b8f 100644 --- a/activemodel/lib/active_model/serializers/xml.rb +++ b/activemodel/lib/active_model/serializers/xml.rb @@ -5,6 +5,7 @@ require 'active_support/core_ext/hash/conversions' require 'active_support/core_ext/hash/slice' module ActiveModel + # == Active Model XML Serializer module Serializers module Xml extend ActiveSupport::Concern @@ -131,6 +132,8 @@ module ActiveModel end end + # Returns XML representing the model. Configuration can be + # passed through +options+. def to_xml(options = {}, &block) Serializer.new(self, options).serialize(&block) end -- cgit v1.2.3