Created
October 18, 2016 00:25
-
-
Save whitmanc/35d299c2880c6e0e497317debb7f93ce to your computer and use it in GitHub Desktop.
Spree - Skip / exclude a model's attribute validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::Product.class_eval do | |
... | |
_validators.reject!{ |key, value| key == :shipping_category } | |
_validate_callbacks.each do |callback| | |
callback.raw_filter.attributes.reject! { |key| key == :shipping_category } if callback.raw_filter.respond_to?(:attributes) | |
end | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment