jakehow / validates_divisible

Simple rails plugin to make sure a value is divisible by a number of your choosing.

This URL has Read+Write access

name age message
file MIT-LICENSE Loading commit data...
file README
file Rakefile
file init.rb
file install.rb
directory lib/
directory tasks/
directory test/
file uninstall.rb
README
ValidatesDivisible
==================

Simple Active Record extension to validate the divisibility of a column.


Example
=======

class Example < ActiveRecord::Base
  validates_divisible :amount, :by=>15, :message=>'must be divisible by 15.'
end

Example.new(:amount => 15).valid? #=> true
Example.new(:amount => 16).valid? #=> false


Copyright (c) 2008 Jake Howerton, released under the MIT license