Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Looking at the documentation over at <a href="http://edgeguides.rubyonrails.org/configuring.html" rel="nofollow">http://edgeguides.rubyonrails.org/configuring.html</a> it seems you can add custom paths to eager load.</p> <p>I quote:</p> <blockquote> <ul> <li><p>config.eager_load when true, eager loads all registered config.eager_load_namespaces. This includes your application, engines, Rails frameworks and any other registered namespace.</p></li> <li><p>config.eager_load_namespaces registers namespaces that are eager loaded when config.eager_load is true. All namespaces in the list must respond to the eager_load! method.</p></li> </ul> </blockquote> <p>What I do find interesting though, is the following.</p> <blockquote> <ul> <li>config.eager_load_paths accepts an array of paths from which Rails will eager load on boot if cache classes is enabled. Defaults to every folder in the app directory of the application.</li> </ul> </blockquote> <p>To me, that would properly eager load your files as well.</p> <p>I'd try adding the following to <code>config/application.rb</code>:</p> <pre><code>config.eager_load_paths += Rails.root.join('app/models/algorithms') </code></pre> <p><strong>Note:</strong> This only works if <code>cache_classes</code> is set to <code>true</code>.</p> <p>You can also eager load a namespace, this could be done by doing:</p> <pre><code>config.config.eager_load_namespaces += Algorithms </code></pre> <p>and then implement a method <code>eager_load!</code> that handles the setup properly.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload