Skip to content

Instantly share code, notes, and snippets.

@moxley
Created April 27, 2013 02:20
Show Gist options
  • Save moxley/5471628 to your computer and use it in GitHub Desktop.
Save moxley/5471628 to your computer and use it in GitHub Desktop.
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