mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
428d47adfe
The focus of this change is to make the API more accessible. References to method and classes should be linked to make it easy to navigate around. This patch makes exzessiv use of `rdoc-ref:` to provide more readable docs. This makes it possible to document `ActiveRecord::Base#save` even though the method is within a separate module `ActiveRecord::Persistence`. The goal here is to bring the API closer to the actual code that you would write. This commit only deals with Active Record. The other gems will be updated accordingly but in different commits. The pass through Active Record is not completely finished yet. A follow up commit will change the spots I haven't yet had the time to update. /cc @fxn
20 lines
478 B
Ruby
20 lines
478 B
Ruby
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(:clone) || {}
|
|
|
|
options[:except] = Array(options[:except]).map(&:to_s)
|
|
options[:except] |= Array(self.class.inheritance_column)
|
|
|
|
super(options)
|
|
end
|
|
end
|
|
end
|