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
# | |
# At CoverHound, we use conditional validations all over the form. However, there is no proper way to do | |
# this in Rails. Instead, we can provide an array of attributes (validated_fields attribute) | |
# and ensure they are the only ones to get validated. | |
# | |
module ConditionalValidations | |
attr_accessor :validated_fields | |
def field_is_required?(field) |