Module: ActiveRecord::Serialization

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::Serializers::JSON
Included in:
Base
Defined in:
lib/active_record/serialization.rb

Overview

Active Record Serialization

Instance Method Summary collapse

Instance Method Details

#serializable_hash(options = nil) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/active_record/serialization.rb', line 13

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