Closed ThiagoCasao closed 4 years ago
Hi @ThiagoCasao . A couple questions:
module Admin
class ApplicationRecord < ActiveRecord::Base
include ::ActiveStorageSupport::SupportForBase64
end
end
notice the ::
before ActiveStorageSupport::SupportForBase64
Hi @santib
Following your instructions, I set the include as you mentionated and I could be able to solve as bellow:
include ::ActiveStorageSupport::SupportForBase64
However, I had to set require 'active_storage_base64'
in ApplicationRecord and in the model class.
Thank you!
Greetings.
I have an engine named "Admin" with a model that includes an attribute avatar like bellow:
class Person < ApplicationRecord has_one_base64_attached :avatar
So following docs, I set:
module Admin class ApplicationRecord < ActiveRecord::Base include ActiveStorageSupport::SupportForBase64
But if I run any command inside the engine, such as
rails g migration
or whatever other rails command, they failed with the following message:uninitialized constant Admin::ApplicationRecord::ActiveStorageSupport). Please require the necessary files (RequireAll::LoadError)
I have set ApplicationRecord inside App that uses the engine and everything is ok. The error only occurs inside the engine.
I tried
require 'active_storage_base64'
in top o ApplicationRecord, but doesn't work.Thank you for your attention.