Refactor update_file_store into a concern
As mentioned in !37878 (merged), we keep reimplementing the update_file_store
method. We should use a concern such as this and possible break the tests out into shared examples:
module UpdateFileStore
extend ActiveSupport::Concern
included do
after_save :update_file_store, if: :saved_change_to_file?
end
private
def update_file_store
# The file.object_store is set during `uploader.store!`
# which happens after object is inserted/updated
self.update_column(:file_store, file.object_store)
end
end