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.3.rc1 lib/active_record/serialization.rb
activerecord-5.1.2 lib/active_record/serialization.rb
activerecord-5.1.2.rc1 lib/active_record/serialization.rb
activerecord-5.0.4 lib/active_record/serialization.rb
activerecord-5.0.4.rc1 lib/active_record/serialization.rb
activerecord-5.1.1 lib/active_record/serialization.rb
activerecord-5.0.3 lib/active_record/serialization.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/activerecord-5.0.2/lib/active_record/serialization.rb
activerecord-5.1.0 lib/active_record/serialization.rb
activerecord-5.1.0.rc2 lib/active_record/serialization.rb
activerecord-5.1.0.rc1 lib/active_record/serialization.rb
activerecord-5.0.2 lib/active_record/serialization.rb
activerecord-5.0.2.rc1 lib/active_record/serialization.rb
activerecord-5.1.0.beta1 lib/active_record/serialization.rb