Module: Dependencies

Extended by:
Dependencies
Included in:
Dependencies
Defined in:
lib/active_record/support/dependencies.rb

Constant Summary collapse

@@loaded =
[ ]
@@mechanism =
:load

Instance Method Summary collapse

Instance Method Details

#associate_with(file_name) ⇒ Object



24
25
26
# File 'lib/active_record/support/dependencies.rb', line 24

def associate_with(file_name)
  depend_on(file_name, true)
end

#clearObject



28
29
30
# File 'lib/active_record/support/dependencies.rb', line 28

def clear
  self.loaded = [ ]
end

#depend_on(file_name, swallow_load_errors = false) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/active_record/support/dependencies.rb', line 12

def depend_on(file_name, swallow_load_errors = false)
  if !loaded.include?(file_name)
    loaded << file_name

    begin
      require_or_load(file_name)
    rescue LoadError
      raise unless swallow_load_errors
    end
  end
end