mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Replace before_validation with custom validation
No reason to use a callback when custom validation methods can be defined.
This commit is contained in:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user