Rake task - with additional class
-
16-01-2021 - |
题
I have my own classes, which I want to use in my rake task. Where to put files with this classes?
解决方案
If the classes are only used by the rake task, I'd keep them in lib/
, just make sure you are loading the directory by configuring autoload_paths
:
# application.rb
config.autoload_paths += %W(#{config.root}/lib)
不隶属于 StackOverflow