module Carrierwave
module Base64
# Railtie class to load the carrierwave-base64 adapters
# Loads adapters for ActiveRecord and Mongoid
class Railtie < Rails::Railtie
ActiveSupport.on_load :active_record do
ActiveRecord::Base.extend Carrierwave::Base64::Adapter
end
ActiveSupport.on_load :mongoid do
Mongoid::Document::ClassMethods.include Carrierwave::Base64::Adapter
end
ActiveSupport.on_load :nobrainer do
puts("extending NoBrainer ...")
NoBrainer::Document::ClassMethods.include Carrierwave::Base64::Adapter
end
end
end
end
I have found ActiveSupport.onload :nobrainer when i use in console this command
When I start my server, I can’t see the puts message, and I have the error message “mount_base64_uploader not defined” like if ActiveSupport.on_load(:nobrainer)was not executed.
Hi, i would like adapt this gem with noBrainer https://github.com/y9v/carrierwave-base64 to upload a file in Base64. So, i update this file https://github.com/y9v/carrierwave-base64/blob/master/lib/carrierwave/base64/railtie.rb and here we can see what has been changed
I have found
ActiveSupport.onload :nobrainer
when i use in console this commandand when I use
nobrainer doesn’t seem to be loaded. Moreover, I’m using the class
NoBrainer::Document::ClassMethods
like it is used in https://github.com/nviennot/carrierwave-nobrainer/blob/master/lib/carrierwave-nobrainer.rb line 150.When I start my server, I can’t see the puts message, and I have the error message “mount_base64_uploader not defined” like if
ActiveSupport.on_load(:nobrainer)
was not executed.Am I missing something? Can you please help me?
Thanks for your help.