Sha256: 19023d6548cd9d301041c7bc3dedbfb754a0eee01caf200c5dca9ae3479d1af2

Contents?: true

Size: 507 Bytes

Versions: 73

Compression:

Stored size: 507 Bytes

Contents

# frozen_string_literal: true

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

73 entries across 73 versions & 7 rubygems

Version Path
activerecord-6.0.6.1 lib/active_record/serialization.rb
activerecord-6.0.6 lib/active_record/serialization.rb
activerecord-6.0.5.1 lib/active_record/serialization.rb
activerecord-5.2.8.1 lib/active_record/serialization.rb
activerecord-5.2.8 lib/active_record/serialization.rb
activerecord-6.0.5 lib/active_record/serialization.rb
activerecord-6.0.4.8 lib/active_record/serialization.rb
activerecord-5.2.7.1 lib/active_record/serialization.rb
activerecord-5.2.7 lib/active_record/serialization.rb
activerecord-6.0.4.7 lib/active_record/serialization.rb
activerecord-5.2.6.3 lib/active_record/serialization.rb
activerecord-6.0.4.6 lib/active_record/serialization.rb
activerecord-5.2.6.2 lib/active_record/serialization.rb
activerecord-5.2.6.1 lib/active_record/serialization.rb
activerecord-6.0.4.5 lib/active_record/serialization.rb
activerecord-6.0.4.4 lib/active_record/serialization.rb
activerecord-6.0.4.3 lib/active_record/serialization.rb
activerecord-6.0.4.2 lib/active_record/serialization.rb
activerecord-6.0.4.1 lib/active_record/serialization.rb
activerecord-6.0.4 lib/active_record/serialization.rb