diff options
author | Rizwan Reza <rizwanreza@gmail.com> | 2010-06-14 13:59:55 +0430 |
---|---|---|
committer | Rizwan Reza <rizwanreza@gmail.com> | 2010-06-14 13:59:55 +0430 |
commit | e67c28dfe00530ff1ce20f6a5982dcb96d505f01 (patch) | |
tree | b2a97c0e8774f76ed9af4a11039cd1b03b081145 | |
parent | 7d7d54fa1fd000703f142a6b44f4e6f264a35270 (diff) | |
download | rails-e67c28dfe00530ff1ce20f6a5982dcb96d505f01.tar.gz rails-e67c28dfe00530ff1ce20f6a5982dcb96d505f01.tar.bz2 rails-e67c28dfe00530ff1ce20f6a5982dcb96d505f01.zip |
Added headings to serializers.
-rw-r--r-- | activemodel/lib/active_model/locale/en.yml | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/serializers/json.rb | 5 | ||||
-rw-r--r-- | 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 <tt>ActiveModel::Base.include_root_in_json</tt> controls the # top-level behavior of to_json. It is true by default. When it is <tt>true</tt>, 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 |