<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Village Idiot &#187; validations</title>
	<atom:link href="http://villageidiotmedia.com/tag/validations/feed/" rel="self" type="application/rss+xml" />
	<link>http://villageidiotmedia.com</link>
	<description>Because the Ruby community needs one</description>
	<lastBuildDate>Sun, 19 Apr 2009 07:09:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Customizing validation errors</title>
		<link>http://villageidiotmedia.com/2008/09/hello-world/</link>
		<comments>http://villageidiotmedia.com/2008/09/hello-world/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 01:03:06 +0000</pubDate>
		<dc:creator>Bobby</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[validations]]></category>

		<guid isPermaLink="false">http://villageidiotmedia.com/?p=1</guid>
		<description><![CDATA[From my code snippets repo, found this snippet from here &#8211; it&#8217;s another way of adding your own error messages (or overriding the default ones Rails throws back).

class User &#60; ActiveRecord::Base
attr_accessor :password_confirmation, :mail_confirmation

before_validation_on_create &#039;self.class.validates_uniqueness_of :name, :message=&#62;“#{self.name} is not available”‘
before_validation_on_create ’self.class.validates_uniqueness_of :mail, :message=&#62;”#{self.mail} is already used by some other user”‘

def validate_on_create
errors.add_on_blank %w( name password mail )
errors.add_on_boundary_breaking(’name’, [...]]]></description>
		<wfw:commentRss>http://villageidiotmedia.com/2008/09/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
