Top Level Namespace

Defined Under Namespace

Modules: Wallaby Classes: Ability

Instance Method Summary collapse

Instance Method Details

#preload(file_pattern) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'app/routes/wallaby/resources_router.rb', line 12

def preload(file_pattern)
  Dir[ file_pattern ].each do |file_path|
    begin
      name = file_path[ %r(app/[^/]+/(.+)\.rb), 1 ].gsub('concerns/', '')
      name.classify.constantize
    rescue NameError, LoadError => e
      Rails.logger.debug "PRELOAD ERROR: #{ e.message }"
    end
  end
end