module Spree
  Adjustment.class_eval do
    has_one :metadata, class_name: 'AdjustmentMetadata'

    scope :enterprise_fee, where(originator_type: 'EnterpriseFee')
  end
end

module Spree
  Adjustment.class_eval do
    has_one :metadata, class_name: 'AdjustmentMetadata', dependent: :destroy

    scope :enterprise_fee, where(originator_type: 'EnterpriseFee')
  end
end

Destroy adjustment metadata when adjustment is destroyed
Destroy adjustment metadata when adjustment is destroyed
