module ActiveModelSerializers

def self.config

def self.config
  ActiveModel::Serializer.config
end

def self.default_include_directive

Returns:
  • (JSONAPI::IncludeDirective) -
def self.default_include_directive
  @default_include_directive ||= JSONAPI::IncludeDirective.new(config.default_includes, allow_wildcard: true)
end

def self.eager_load!

def self.eager_load!
  super
  ActiveModel::Serializer.eager_load!
end

def self.location_of_caller

The file name and line number of the caller of the caller of this method.
def self.location_of_caller
  caller[1] =~ /(.*?):(\d+).*?$/i
  file = Regexp.last_match(1)
  lineno = Regexp.last_match(2).to_i
  [file, lineno]
end

def self.silence_warnings

def self.silence_warnings
  original_verbose = $VERBOSE
  $VERBOSE = nil
  yield
ensure
  $VERBOSE = original_verbose
end