Validates As UK Postcode (version 1.0)
======================================
This Ruby on Rails plugin implements an ActiveRecord validation helper
called validates_as_uk_postcode. The helper acts as if
validates_format_of was used with a regular expression that defines an
valid UK postcode:
http://www.govtalk.gov.uk/gdsc/html/frames/PostCode.htm
Installation
------------
ruby script/plugin install http://github.com/srushe/validates_as_uk_postcode/tree/master
Full documentation on script/plugin can be obtained by invoking the
plugin script with no arguments:
ruby script/plugin
Usage
-----
In your model file do something like:
class MyClass < ActiveRecord::Base
validates_as_uk_postcode :postcode
end
License
-------
This code is released under a Creative Commons Attribution-Share Alike
3.0 Unported License. The license can be seen here:
http://creativecommons.org/licenses/by-sa/3.0/
The original version of the code (see History) was released under the
Creative Commons Attribution-Share Alike 2.5 License, which can be seen
at:
http://creativecommons.org/licenses/by-sa/2.5/
History
-------
This plugin was originally written in 2007 when I worked at Design By
Front. I took the code for validates_as_email as my inspiration so the
plugin was released under the same license, the Creative Commons
Attribution-Share Alike 2.5 License, and made available via the company
svn server.
In recent months (as of March 2009) I've noticed that the address the
code was available at has not been responding. Therefore I've located
the code, tweaked some things, and I'm releasing this version of it.
This new version is being released under the newer Creative Commons
Attribution-Share Alike 3.0 Unported License.
Credits
-------
Written by Stephen Rushe (http://deeden.co.uk/)
Original version written by the author at Design By Front.