Commit 6b1f6104 by Fabio Kreusch

Uses a faster implementation for ensure_required_validations!

parent e8c1dc8a
...@@ -389,12 +389,8 @@ module Paperclip ...@@ -389,12 +389,8 @@ module Paperclip
@instance.class.validators.map(&:class) @instance.class.validators.map(&:class)
end end
def required_validator_classes
Paperclip::REQUIRED_VALIDATORS + Paperclip::REQUIRED_VALIDATORS.flat_map(&:descendants)
end
def missing_required_validator? def missing_required_validator?
(active_validator_classes & required_validator_classes).empty? (active_validator_classes.flat_map(&:ancestors) & Paperclip::REQUIRED_VALIDATORS).empty?
end end
def ensure_required_validations! def ensure_required_validations!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment