Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Rails 3 autoload paths isn't loading some folders but is loading others

I'm using the autoload path's in the application.rb to loads some extra modules and structs.

This is the following bit of code doing it:

config.autoload_paths += %W(
  #{config.root}/app/controllers/concerns 
  #{config.root}/app/models/concerns 
  #{config.root}/app/jobs/
)

The funny thing is both of the "concerns" folders for extending models and controllers are working perfectly.

However the jobs folder is not getting loaded at all.

Is there something special I need to do in order to get a folder in app to be loads or does anyone know why two of these folders are loading and the third isn't?

like image 395
MintDeparture Avatar asked Mar 23 '13 09:03

MintDeparture


1 Answers

Try and remove the trailing slash after jobs.

config.autoload_paths += %W(
  #{config.root}/app/controllers/concerns 
  #{config.root}/app/models/concerns 
  #{config.root}/app/jobs
)
like image 70
Luís Ramalho Avatar answered Oct 28 '22 20:10

Luís Ramalho