Skip to content

Adapting plugins error? #11

@bigtunacan

Description

@bigtunacan

In the section on adapting plugins (https://github.com/alindeman/upgradingtorails4/blob/master/text/05_plugins.markdown) it describes setting up an initializer for the plugin and updating autoload_paths in the initializer as follows.

ActiveSupport::Dependencies.autoload_paths << "#{Rails.root}/lib/acts_as_tree/lib"

Trying to require a file that resides in the modified autoload_paths does not get loaded correctly. If I move the autoload_paths modification into the application config file however it works fine.

I noticed in the Rails Guides on autoloading availability (http://guides.rubyonrails.org/autoloading_and_reloading_constants.html#autoloading-availability) the following is mentioned.

config.autoload_paths is accessible from environment-specific configuration files, but any changes made to it outside config/application.rb don't have an effect.

Possibly this was locked down due to security concerns?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions