Sha256: d6ea0f26e4e414fc9c81dc062ba7e05f38d88db318492688467673a247743b6c

Contents?: true

Size: 685 Bytes

Versions: 69

Compression:

Stored size: 685 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)
      if self.class._has_attribute?(self.class.inheritance_column)
        options = options ? options.dup : {}

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

      super(options)
    end

    private
      def attribute_names_for_serialization
        attribute_names
      end
  end
end

Version data entries

69 entries across 68 versions & 8 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.3.4/lib/active_record/serialization.rb
activerecord-8.0.1 lib/active_record/serialization.rb
activerecord-8.0.0.1 lib/active_record/serialization.rb
activerecord-7.2.2.1 lib/active_record/serialization.rb
activerecord-7.1.5.1 lib/active_record/serialization.rb
activerecord-7.0.8.7 lib/active_record/serialization.rb
activerecord-8.0.0 lib/active_record/serialization.rb
activerecord-7.2.2 lib/active_record/serialization.rb
activerecord-7.1.5 lib/active_record/serialization.rb
activerecord-8.0.0.rc2 lib/active_record/serialization.rb
activerecord-7.2.1.2 lib/active_record/serialization.rb
activerecord-7.1.4.2 lib/active_record/serialization.rb
activerecord-7.0.8.6 lib/active_record/serialization.rb
activerecord-8.0.0.rc1 lib/active_record/serialization.rb
activerecord-7.2.1.1 lib/active_record/serialization.rb
activerecord-7.1.4.1 lib/active_record/serialization.rb
activerecord-7.0.8.5 lib/active_record/serialization.rb
activerecord-8.0.0.beta1 lib/active_record/serialization.rb
omg-activerecord-8.0.0.alpha9 lib/active_record/serialization.rb
omg-activerecord-8.0.0.alpha8 lib/active_record/serialization.rb