Commit db92768 1 parent 5435b1c commit db92768 Copy full SHA for db92768
File tree 1 file changed +1
-2
lines changed
lib/rails_admin/config/fields/factories
1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change 1
1
require 'rails_admin/config/fields'
2
2
require 'rails_admin/config/fields/types'
3
3
require 'rails_admin/config/fields/types/file_upload'
4
- require 'rails_admin/adapters/active_record/association'
5
4
6
5
RailsAdmin ::Config ::Fields . register_factory do |parent , properties , fields |
7
- if defined? ( ::ActiveStorage ) && properties . is_a? ( RailsAdmin :: Adapters :: ActiveRecord :: Association ) && ( match = /\A (.+)_attachments?\Z / . match properties . name ) && properties . klass . to_s == 'ActiveStorage::Attachment'
6
+ if defined? ( ::ActiveStorage ) && properties . try ( :association? ) && ( match = /\A (.+)_attachments?\Z / . match properties . name ) && properties . klass . to_s == 'ActiveStorage::Attachment'
8
7
name = match [ 1 ]
9
8
field = RailsAdmin ::Config ::Fields ::Types . load (
10
9
properties . type == :has_many ? :multiple_active_storage : :active_storage ,
You can’t perform that action at this time.
0 commit comments