From 7d37be310517ee26384e4e75b01a55baea7053a8 Mon Sep 17 00:00:00 2001 From: Victor Palomo de Castro Date: Thu, 15 Nov 2018 19:12:27 -0200 Subject: [PATCH] const RailsAdmin::Adapters::ActiveRecord missing every time I initialize my Mongoid Model --- lib/rails_admin/config/fields/factories/active_storage.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rails_admin/config/fields/factories/active_storage.rb b/lib/rails_admin/config/fields/factories/active_storage.rb index 394d0b3fe3..e564752593 100644 --- a/lib/rails_admin/config/fields/factories/active_storage.rb +++ b/lib/rails_admin/config/fields/factories/active_storage.rb @@ -1,6 +1,7 @@ require 'rails_admin/config/fields' require 'rails_admin/config/fields/types' require 'rails_admin/config/fields/types/file_upload' +require 'rails_admin/adapters/active_record/association' RailsAdmin::Config::Fields.register_factory do |parent, properties, fields| if defined?(::ActiveStorage) && properties.is_a?(RailsAdmin::Adapters::ActiveRecord::Association) && (match = /\A(.+)_attachments?\Z/.match properties.name) && properties.klass.to_s == 'ActiveStorage::Attachment'