View Code? Open in Web Editor
NEW
Attributes Validation Extension for ActiveRecord/ActiveModel
License: MIT License
attribute_validation's Introduction
attribute_validation's People
Contributors
Stargazers
attribute_validation's Issues
def valid_attributes?(*attr_names, **options)
self.class.validators_on(*attr_names).zip(attr_names) do |validator, attribute|
validator.validate_each(self, attribute, send(attribute))
end
errors.empty?
end
Issue
Because the behavior is different from the existing implementation. In particular, the existing treats blank string as nil, but the other not.