Method: Mongoid::Association::Referenced::HasMany::Enumerable#to_json

Defined in:
lib/mongoid/association/referenced/has_many/enumerable.rb

#to_json(options = {}) ⇒ String

Send #to_json to the entries.

Examples:

Get the enumerable as json.

enumerable.to_json

Parameters:

  • options (Hash) (defaults to: {})

    Optional parameters.

Returns:

  • (String)

    The entries all _loaded as a string.



457
458
459
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 457

def to_json(options = {})
  entries.to_json(options)
end