Skip to content

Instantly share code, notes, and snippets.

@pinzolo
Last active December 20, 2015 12:28
Redmine はプラグインの app/{controllers,models,helpers} しか自動的にロードしてくれないので、その他のディレクトリをロードさせる
Redmine::Plugin.register :hoge do
# other plugin settings
# simple
ActiveSupport::Dependencies.autoload_paths += [File.dirname(__FILE__) + "/app/forms"]
# multiple
Dir.glob(File.expand_path(File.join(File.dirname(__FILE__), "app", "{forms,services}"))) do |dir|
ActiveSupport::Dependencies.autoload_paths += [dir]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment