ruby on rails - How do I call my namespaced class from the lib directory -


i have class that's 3 levels deep in lib directory i'm trying call uninitialized constant error. class , directory structure looks this:

file name: lib/my_module/my_second_module/my_third_module/my_class.rb

module my_module   module my_second_module     module my_third_module       class my_class         def self.something           something...         end       end     end   end end 

i'm trying call class using rails console returns 'uninitialized constant my_module'. run command , error:

mymodule::mysecondmodule::mythirdmodule::myclass.something 

also i've include following in config/application.rb

config.autoload_paths += dir["#{config.root}/lib/my_module/**/"] 

try ::mymodule::mysecondmodule::mythirdmodule::myclass.something


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -