Replace before_validation with custom validation

No reason to use a callback when custom validation methods can be
defined.
This commit is contained in:
Pau Perez
2020-07-22 14:44:58 +02:00
parent f2fd426c4a
commit f2b28a198d

View File

@@ -22,7 +22,7 @@ module Spree
has_one :adjustment, as: :source, dependent: :destroy
before_validation :validate_source
validate :validate_source
before_save :set_unique_identifier
after_save :create_payment_profile, if: :profiles_supported?