method

as_json

Importance_1
v3.2.13 - Show latest stable - 1 note - Class: ActiveRecord::Relation
as_json(options = nil) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Show source
Register or log in to add new notes.
December 20, 2017
0 thanks

Effectively identical to Hash#as_json

As of 5.2.0.beta, there is no ActiveRecord::Relation specific implementation. This will result in Object#as_json , which will convert the relation to a hash and call Hash#as_json .

class Object
  def as_json(options = nil) #:nodoc:
    if respond_to?(:to_hash)
      to_hash.as_json(options)
    else
      instance_values.as_json(options)
    end
  end
end