Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added headings to serializers.

  • Loading branch information...
commit e67c28dfe00530ff1ce20f6a5982dcb96d505f01 1 parent 7d7d54f
Rizwan Reza rizwanreza authored
2  activemodel/lib/active_model/locale/en.yml
View
@@ -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
5 activemodel/lib/active_model/serializers/json.rb
View
@@ -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 <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>,
3  activemodel/lib/active_model/serializers/xml.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.