Where to play specific classes? (Rails 3)

I have a couple of classes that are only used with the rake command. I understand that rake tasks usually live @ lib / tasks / whatever.rake, but where should I place helper classes?

Thanks!

+6
source share
2 answers

$RAILS_ROOT/lib or $RAILS_ROOT/lib/special_task/ is likely to be the best as the default download path, and you can do simple require 'my_task_helper' or require 'special_task/helper' respectively.

+1
source

Directly inside "lib" if you are loading the Rails framework for tasks.

You can also make them plugins if there are too many.

+1
source

Source: https://habr.com/ru/post/893528/


All Articles