I currently have this folder directory
- app
- controllers
- project_controller.rb
- subtasks
- index_helper.rb
- controllers
project_controller.rb
class ProjectController < ApplicationController
include Subtasks::IndexHelper
index_helper.rb
module Subtasks::IndexHelper
....
This configuration works locally without a require
statement.
But when run on a CI (semaphoreci) it returns
ActionController::RoutingError:
uninitialized constant Subtasks::IndexHelper
I've tried to use the autoload function by adding all possible sub-configurations of
config.autoload_paths.push "#{config.root}/app/controllers/subtasks"
but this throws a different error
Failure/Error: include Subtasks::IndexHelper
LoadError:
Unable to autoload constant IndexHelper, expected
/home/runner/app/controllers/subtasks/index_helper.rb to define it
My Question is: Is there any way to include this module without any require
, require_relative
, require_dependency
clauses? This setup worked a couple months back, but it all of a sudden started failing.