method
as_json
v2.3.8 -
Show latest stable
- Class:
ActiveRecord::Serialization
as_json(options = nil)public
No documentation available.
# File activerecord/lib/active_record/serializers/json_serializer.rb, line 80
def as_json(options = nil) #:nodoc:
hash = Serializer.new(self, options).serializable_record
hash = { options[:root] || self.class.model_name.element => hash } if include_root_in_json
hash
end