diff --git a/activemodel/lib/active_model/locale/en.yml b/activemodel/lib/active_model/locale/en.yml index 602a530dc01f7671b6a1ee784559c7faf9fe0049..44425b4a28df14007dc20fedfe7a5ab5a4e77712 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 90305978c43ce4880b232f57ab2a13e7f758a366..918cd0ab7650e925fa7275f876cb40b610f58698 100644 --- a/activemodel/lib/active_model/serializers/json.rb +++ b/activemodel/lib/active_model/serializers/json.rb @@ -2,6 +2,7 @@ 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 JSON 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 934af2b8a81536ffba2e24ee078ad6b65133037e..ed64434b8f655ccde38c3376bc1c12a729aa5a1d 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/slice' module ActiveModel + # == Active Model XML Serializer module Serializers module Xml extend ActiveSupport::Concern @@ -131,6 +132,8 @@ def add_procs 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