Skip to content

Instantly share code, notes, and snippets.

@phlegx
Created May 31, 2012 22:37
Show Gist options
  • Save phlegx/2846852 to your computer and use it in GitHub Desktop.
Save phlegx/2846852 to your computer and use it in GitHub Desktop.
validates_numericality_of :channel_weight,
:only_integer => true,
:message => "integer values only.",
:allow_blank => true,
:if => Proc.new { |record| record.analogue_to != "None" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment