Created
April 27, 2013 02:20
-
-
Save moxley/5471628 to your computer and use it in GitHub Desktop.
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
def validate_colors | |
colors = %w(color_title color_title2 color_title3 color_title4) | |
as_str = colors.map {|c| send(c).present? : 'p' : ' '} | |
trimmed = as_str.trim | |
if trimmed =~ / / | |
errors[:base] << "Blank color found before non-black color" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment