I have a rails application in that I have modules inside /app/adapters/UDB/
folder. The module is not loading. I have added the following in application.rb
config.autoload_paths += Dir["#{config.root}/app/adapters/**/*"]
I am calling module from model file /models/userinvite.rb
def update_cassandra
ypusers = UDB::YpRewards.new.ypusers
ypusers.execute("UPDATE invitation_backlog SET invitation_code = '#{invitation_code}', invitation_sent_date = #{invitation_sent_date.to_i * 1000}, invited_by = '#{invited_by}' WHERE email_address = '#{email}'")
end
/app/adapters/UDB/yp_rewards.rb
module UDB
class YpRewards
def initialize
end
def ypusers
@ypusers ||= UDB::Connection.new.connection.connect('ypusers')
end
...
Please help me solving it.
I think the issue is with module name.
Your module name is UDB, then you can load this module by specifying its name in smallcase letters as per rails naming convention (camelcasing)