public
Description: ActiveRecord plugin that allows validate_acceptance_of to be used with a real db column. This is included in ActiveRecord as of rails 2.0
Clone URL: git://github.com/ambethia/vao_column.git
vao_column / README
100644 29 lines (20 sloc) 0.72 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
VAoColumn
=========
 
Allow validates_acceptance_of to store value on a database column of
the same name.
 
An example use case here, is that you want to use the current version
of the EULA as the :accept value, and store that column, so you can
refer to the explicit version the user accepted at a later date.
 
Example
=======
 
  ActiveRecord::Schema.define do
    create_table :pirates, :force => true do |t|
      t.column :catchphrase, :string
    end
  end
 
  class Pirate < ActiveRecord::Base
    validates_acceptance_of(:catchphrase, :accept => "Argh!")
  end
 
  "catchphrase" is a normal column method on the model, not just a
  virtual accessor.
 
 
Copyright (c) 2007 Jason L Perry, released under the MIT license