module Mongoid::Serializable

def relation_options(inclusions, options, name)

Other tags:
    Since: - 2.0.0.rc.6

Returns:
  • (Hash) - The options for the association.

Parameters:
  • name (Symbol) -- The name of the association.
  • options (Hash) -- The options.
  • inclusions (Hash, Symbol, Array) -- The inclusions.

Other tags:
    Example: Get the association options. -
def relation_options(inclusions, options, name)
  if inclusions.is_a?(Hash)
    inclusions[name]
  else
    { except: options[:except], only: options[:only] }
  end
end