module ActiveSupport::Dependencies::Loadable

Private Instance Methods

require(file) click to toggle source

Monkey patched because Ruby's `require` doesn't load files that don't end in `.rb`, so we have to use `load` for decorators.

The difference in semantics between `require` and `load` won't really matter since Rails handles this in development and code doesn't get reloaded in other environments.

This module is mixed in to Object.

Calls superclass method
# File lib/rails/decorators/active_support.rb, line 15
def require(file)
  file_string = file.to_s

  if file_string.end_with?(".#{Rails::Decorators.extension}")
    load(file_string)
  else
    super
  end
end