Hi there !
I’m doing a rails engine and I have written several ruby modules in it
will be included in the models of the future client Rails applications.
I’m facing a weird issue now : The modules inside my engine use
mongoid. (To append fields to models, declare indexes and stuff) But
use the DateTime type for some fields, it will throw a NoMethod error
save like :
undefined method `bson_dump’ for XXXX
I checked the sources of Mongoid and identified where all the extension
logic (for DateTime especially) was implemented.
Is it that I did not properly require dependencies or something ?
Because I have correctly added mongoid gem to my engine dependencies
gemspec and I even require ‘mongoid’ in my engine.rb file, so that all
initialization of mongoid could be entirely done before my engine
Thank you for your attention
One of my module looks like :
field :starts_at, :type => DateTime
MyEvent.new :starts_at => DateTime.now