def save_bt_association(assoc, version)
      assoc_version_args = {
        version_id: version.id,
        foreign_key_name: assoc.foreign_key
      }

      if assoc.options[:polymorphic]
        foreign_type = @record.send(assoc.foreign_type)
        if foreign_type && ::PaperTrail.request.enabled_for_model?(foreign_type.constantize)
          assoc_version_args[:foreign_key_id] = @record.send(assoc.foreign_key)
          assoc_version_args[:foreign_type] = foreign_type
        end
      elsif ::PaperTrail.request.enabled_for_model?(assoc.klass)
        assoc_version_args[:foreign_key_id] = @record.send(assoc.foreign_key)
        assoc_version_args[:foreign_type] = assoc.klass
      end

      if assoc_version_args.key?(:foreign_key_id)
        ::PaperTrail::VersionAssociation.create(assoc_version_args)
      end
    end
def save_bt_association(assoc, version)
      assoc_version_args = {
        version_id: version.id,
        foreign_key_name: assoc.foreign_key
      }

      if assoc.options[:polymorphic]
        foreign_type = @record.send(assoc.foreign_type)
        if foreign_type && ::PaperTrail.request.enabled_for_model?(foreign_type.constantize)
          assoc_version_args[:foreign_key_id] = @record.send(assoc.foreign_key)
          assoc_version_args[:foreign_type] = foreign_type
        end
      elsif ::PaperTrail.request.enabled_for_model?(assoc.klass)
        assoc_version_args[:foreign_key_id] = @record.send(assoc.foreign_key)
        assoc_version_args[:foreign_type] = assoc.klass
      end

      if assoc_version_args.key?(:foreign_key_id)
        ::PaperTrail::VersionAssociation.create(assoc_version_args)
      end
    end
Save a single `belongs_to` association.
 @api private