ActiveStorage Blobs table, possible to ignore column?

Viewed 74

I'm doing a Rails 6.1 upgrade at the moment and wondering if there's a way to set the new service_name column to be ignored. I know how to do this with an ActiveRecord table, but not a Rails' internal table (not sure what to call it).

So above details aside, how does one set a column in the active_storage_blobs table to be ignored?

1 Answers
# app/initializers/active_storage_ignore_service_name_backport.rb

module ActiveStorageIgnoreServiceNameBackport
  extend ActiveSupport::Concern

  included do
    ignored_columns = [:service_name]
  end
end

Rails.configuration.to_prepare do
  ActiveStorage::Blob.include(ActiveStorageIgnoreServiceNameBackport)
end
Related