Module mixin issue

I am executing some scripts from the script directory.

script files:

script1:
require File.dirname(FILE) + ‘/…/config/boot’
require File.dirname(FILE) + ‘/…/config/environment’
module DataLoad

end

script 2 being executed:

require File.dirname(FILE) + ‘/…/config/boot’
require File.dirname(FILE) + ‘/…/config/environment’

classB.generate

classes in model dir:

class A
include DataLoad
end

class B < class A
def self.generate
end

Error executing the script2:

`const_missing’: uninitialized constant AvailabilityReport::DataLoad
(NameError)

Error executing the script2:

`const_missing’: uninitialized constant AvailabilityReport::DataLoad
(NameError)

You’ll need to require the file defining that module yourself

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs