CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Thu, 28 Aug 2025 09:08:42 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20081011054709
location: https://web.archive.org/web/20081011054709/https://github.com/fhwang/validates_with_block/tree
server-timing: captures_list;dur=2.261577, exclusion.robots;dur=0.023314, exclusion.robots.policy;dur=0.010095, esindex;dur=0.011646, cdx.remote;dur=60.671586, LoadShardBlock;dur=337.781224, PetaboxLoader3.datanode;dur=94.050639, PetaboxLoader3.resolve;dur=74.204569
x-app-server: wwwb-app239
x-ts: 302
x-tr: 532
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app239; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Thu, 28 Aug 2025 09:08:43 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Sat, 11 Oct 2008 12:47:09 GMT
x-archive-orig-transfer-encoding: chunked
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_sess=BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%250ASGFzaHsABjoKQHVzZWR7AA%253D%253D--4d8802a39cf2ae2680fcdf915bd7f8472555cf65; domain=.github.com; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 0.58145
x-archive-orig-etag: "866dc330c2d0c948cdef29c304f9b34f"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-x_commoncrawl_parsesegmentid: 4384
x-archive-orig-x_commoncrawl_originalurl: https://github.com/fhwang/validates_with_block/tree
x-archive-orig-x_commoncrawl_urlfp: -7754278080908438264
x-archive-orig-x_commoncrawl_hostfp: -8801896244620822287
x-archive-orig-x_commoncrawl_signature: 866dc330c2d0c948cdef29c304f9b34f
x-archive-orig-x_commoncrawl_crawlno: 1
x-archive-orig-x_commoncrawl_fetchtimestamp: 1223729229679
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
x-archive-orig-content-encoding: gzip
memento-datetime: Sat, 11 Oct 2008 05:47:09 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 14 Jun 2008 14:11:07 GMT", ; rel="prev memento"; datetime="Sat, 14 Jun 2008 14:11:07 GMT", ; rel="memento"; datetime="Sat, 11 Oct 2008 05:47:09 GMT", ; rel="last memento"; datetime="Sat, 11 Oct 2008 05:47:09 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 1224042347617_53-c/1224042530887_40.arc.gz
server-timing: captures_list;dur=0.490308, exclusion.robots;dur=0.017300, exclusion.robots.policy;dur=0.007909, esindex;dur=0.009000, cdx.remote;dur=5.631255, LoadShardBlock;dur=248.597809, PetaboxLoader3.datanode;dur=208.954753, PetaboxLoader3.resolve;dur=114.327623, load_resource;dur=176.133212
x-app-server: wwwb-app239
x-ts: 200
x-tr: 497
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
fhwang's validates_with_block at master — GitHub
This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (

This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (

Description: | dynamic, more readable block-driven validation for ActiveRecord models. |
Clone URL: |
git://github.com/fhwang/validates_with_block.git
Give this clone URL to anyone.
git clone git://github.com/fhwang/validates_with_block.git
|

Francis Hwang (author)
Thu Jun 12 15:03:25 -0700 2008
name | age | message | |
---|---|---|---|
![]() |
.gitignore | Wed May 14 09:45:04 -0700 2008 | adding tests [Francis Hwang] |
![]() |
MIT-LICENSE | Thu May 15 07:45:06 -0700 2008 | added MIT-LICENSE [Francis Hwang] |
![]() |
README | Wed May 14 10:04:43 -0700 2008 | cleanup doco [Francis Hwang] |
![]() |
Rakefile | Thu Jun 12 15:03:25 -0700 2008 | Rakefile tweak [Francis Hwang] |
![]() |
init.rb | Wed May 14 08:31:35 -0700 2008 | first commit [Francis Hwang] |
![]() |
install.rb | Wed May 14 08:31:35 -0700 2008 | first commit [Francis Hwang] |
![]() |
lib/ | Wed Jun 11 13:52:04 -0700 2008 | Include all instance methods when checking attr... [binary42] |
![]() |
tasks/ | Wed May 14 08:31:35 -0700 2008 | first commit [Francis Hwang] |
![]() |
test/ | Wed Jun 11 13:39:20 -0700 2008 | added a test [Francis Hwang] |
![]() |
uninstall.rb | Wed May 14 08:31:35 -0700 2008 | first commit [Francis Hwang] |
README
= ValidatesWithBlock A plugin that allows for dynamic, more readable block-driven validation for ActiveRecord models. == Installing as a plugin EDGE Rails has support for plugin installation from Git, so if you're using EDGE Rails you can install with: ./script/plugin install git://github.com/fhwang/validates_with_block.git We're maintaining an SVN clone of the plugin for those of you who aren't on EDGE Rails yet: ./script/plugin install svn://rubyforge.org/var/svn/nycrb/validates_with_block == Using ValidatesWithBlock Basically this plugin is meant to help you make your models a little cleaner if you've got a lot of validations. Instead of: validates_presence_of :login, :message => 'Please enter a login.' validates_uniqueness_of :login, :case_sensitive => false validates_format_of :login, :with => /\A\w*\Z/ validates_length_of :login, :within => 4..15 You can write: validates_login do |login| login.present :message => 'Please enter a login.' login.unique :case_sensitive => false login.formatted :with => /\A\w*\Z/ login.length :within => 4..15 end The methods map to validation methods as follows: login.confirmed => validates_confirmation_of login.formatted => validates_format_of login.formatted_as_email => validates_email_format_of login.length => validates_length_of login.present => validates_presence_of login.unique => validates_uniqueness_of == formatted_as_email You may have noticed the inclusion of validates_email_format_of; that's not a standard ActiveRecord validation. It comes from the very useful validates_email_format_of plugin, which is available at https://code.dunae.ca/validates_email_format_of.html . Obviously formatted_as_email won't work if you haven't installed this plugin. == Contact If you have any bugs, questions, etc., please feel to email me: Francis Hwang francis@diversionmedia.com
This feature is coming soon. Sit tight!