public
Description:
Homepage: http://svn.viney.net.nz/things/rails/plugins/active_record_defaults/
Clone URL: git://github.com/aussiegeek/active_record_defaults.git
100644 34 lines (19 sloc) 0.888 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
30
31
32
33
34
= Active Record Defaults
 
If you find this plugin useful, please consider a donation to show your support!
 
  http://www.paypal.com/cgi-bin/webscr?cmd=_send-money
  
  Email address: jonathan.viney@gmail.com
  
== Instructions
 
Allow you to easily specify default values for attributes on new model objects. Eg:
 
  class Person < ActiveRecord::Base
    defaults :country => 'New Zealand', :type => 'Unknown', :address => proc { Address.new }
    
    default :last_name do |person|
      person.first_name
    end
  end
  
The default value is only used if the attribute is not present in the attributes hash.
 
See active_record_defaults.rb for full documentation.
  
== Installation
 
  script/plugin install http://svn.viney.net.nz/things/rails/plugins/active_record_defaults
  
== Help
 
Feel free to email with any problems, suggestions, bugs etc...
 
  jonathan dot viney @ gmail . com