Skip to content

Instantly share code, notes, and snippets.

@biske
Forked from maxim/rails_code_loading.md
Last active August 29, 2015 14:10
Show Gist options
  • Save biske/7551de3aed544c4fbef6 to your computer and use it in GitHub Desktop.
Save biske/7551de3aed544c4fbef6 to your computer and use it in GitHub Desktop.
+-----------------------+------------------+-----------------+
|                       | eager load paths | auto load paths |
+-----------------------+------------------+-----------------+
| Rails 3 (development) | auto loaded      | auto loaded     |
| Rails 4 (development) | auto loaded      | auto loaded     |
| Rails 3 (production)  | eager loaded     | auto loaded     |
| Rails 4 (production)  | eager loaded     | eager loaded    |
+-----------------------+------------------+-----------------+

Same in Rails 3.2 and Rails 4

  • Rails defaults:
    • eager_load: 'app/'
    • autoload: nothing
  • Eager load paths get globbed via path/**/*.rb
  • Autoload paths are roots from which Const.underscore should match dir structure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment