-
-
Save bricker/7992641 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| def slides_exists_and_are_hashed_yaml | |
| return if slides.blank? | |
| slides_yml = YAML.load(slides) | |
| if Array(slides_yml).any? { |_, v| v.nil? } || slides_yml.instance_of?(String) | |
| errors.add(:slides, 'not a valid YAML file (did you include at least one key: value?)') | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment