Method 1
If all models are inherited by an abstract class (for example: "ApplicationRecord"),
you can create a new file (for example:) app/models/concerns/exclude_versions.rb:
module ExcludeVersions
extend ActiveSupport::Concern
included do
rails_admin do
configure :versions do
hide
end
end
end
end
:
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
has_paper_trail
def self.inherited(subclass)
subclass.include(ExcludeVersions)
super
end
end
2
, config/initializers/rails_admin.rb
Rails.application.eager_load! if Rails.env.development?
ActiveRecord::Base.descendants.each do |imodel|
config.model "#{imodel.name}" do
configure :versions do
hide
end
end
end
: https://github.com/sferik/rails_admin/wiki/Models#configuring-models-all-at-once