Sha256: 7a529b39f0dc29915fbe89ff8e91f5c09a1da46dff93f04dfa2486023c22070c

Contents?: true

Size: 476 Bytes

Versions: 34

Compression:

Stored size: 476 Bytes

Contents

module ActiveRecord #:nodoc:
  # = Active Record \Serialization
  module Serialization
    extend ActiveSupport::Concern
    include ActiveModel::Serializers::JSON

    included do
      self.include_root_in_json = false
    end

    def serializable_hash(options = nil)
      options = options.try(:dup) || {}

      options[:except] = Array(options[:except]).map(&:to_s)
      options[:except] |= Array(self.class.inheritance_column)

      super(options)
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
activerecord-5.1.7 lib/active_record/serialization.rb
activerecord-5.1.7.rc1 lib/active_record/serialization.rb
activerecord-5.1.6.2 lib/active_record/serialization.rb
activerecord-5.0.7.2 lib/active_record/serialization.rb
activerecord-5.1.6.1 lib/active_record/serialization.rb
activerecord-5.0.7.1 lib/active_record/serialization.rb
activerecord-5.1.6 lib/active_record/serialization.rb
activerecord-5.0.7 lib/active_record/serialization.rb
activerecord-5.1.5 lib/active_record/serialization.rb
activerecord-5.1.5.rc1 lib/active_record/serialization.rb
activerecord-5.1.4 lib/active_record/serialization.rb
activerecord-5.0.6 lib/active_record/serialization.rb
activerecord-5.1.4.rc1 lib/active_record/serialization.rb
activerecord-5.0.6.rc1 lib/active_record/serialization.rb
activerecord-5.1.3 lib/active_record/serialization.rb
activerecord-5.1.3.rc3 lib/active_record/serialization.rb
activerecord-5.0.5 lib/active_record/serialization.rb
activerecord-5.0.5.rc2 lib/active_record/serialization.rb
activerecord-5.1.3.rc2 lib/active_record/serialization.rb
activerecord-5.0.5.rc1 lib/active_record/serialization.rb