Where to load Mongoid


#1

I’m new to Jets. It looks awesome!

I’m trying to figure out where the best load the mongoid gem. I’m assuming that I want it to be in the Lambda Execution Context. I just don’t know where to run the following code.

Mongoid.load!(File.join(File.dirname(__FILE__), 'config', 'mongoid.yml'))

Thanks,
Mark


#2

Thinking probably https://rubyonjets.com/docs/initializers/


#3

Thanks! Do I need to run Jets.once in the script? Or is that handled by the process running the initializers?


#4

No need to call Jets.once. :+1: