Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 19 lines (14 sloc) 0.481 kB
e86d1cd @dhh Added ActiveRecord::Base#to_json/from_json (currently does not suppor…
dhh authored
1 module ActiveRecord #:nodoc:
4e3eec3 @rizwanreza Adds title and proper formatting to docs.
rizwanreza authored
2 # = Active Record Serialization
e86d1cd @dhh Added ActiveRecord::Base#to_json/from_json (currently does not suppor…
dhh authored
3 module Serialization
c6bc8e6 @josh Break up concerns for choosing what attributes should be serialized a…
josh authored
4 extend ActiveSupport::Concern
5b2eb64 @josevalim Revert "Implement ArraySerializer and move old serialization API to a…
josevalim authored
5 include ActiveModel::Serializers::JSON
c6bc8e6 @josh Break up concerns for choosing what attributes should be serialized a…
josh authored
6
7 def serializable_hash(options = nil)
2524cf4 @mackuba fixed some issues with JSON encoding
mackuba authored
8 options = options.try(:clone) || {}
c6bc8e6 @josh Break up concerns for choosing what attributes should be serialized a…
josh authored
9
10 options[:except] = Array.wrap(options[:except]).map { |n| n.to_s }
11 options[:except] |= Array.wrap(self.class.inheritance_column)
12
4860143 ActiveModel support for the :include serialization option
John Firebaugh authored
13 super(options)
c6bc8e6 @josh Break up concerns for choosing what attributes should be serialized a…
josh authored
14 end
e86d1cd @dhh Added ActiveRecord::Base#to_json/from_json (currently does not suppor…
dhh authored
15 end
16 end
17
18 require 'active_record/serializers/xml_serializer'
Something went wrong with that request. Please try again.