Created
February 19, 2010 17:32
-
-
Save pragdave/308953 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
validates :title, :description, :image_url, :presence => true | |
validates :price, :numericality => { :greater_than => 0 } | |
validates :title, :uniqueness => true | |
validates :image_url, | |
:format => { :with => %r{\.(gif|jpg|png)$}i, | |
:message => 'must be a URL for GIF, JPG or PNG image.' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment