Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 39 lines (21 sloc) 0.934 kb
0d63432 @midas Release 1.0.1.
authored
1 = Changes for this Fork
2
3 * Ported to a Gem.
4
5
0bfeb6b git-svn-id: http://svn.viney.net.nz/things/rails/plugins/active_recor…
jonathan authored
6 = Active Record Defaults
7
8 If you find this plugin useful, please consider a donation to show your support!
9
ccb14a9 git-svn-id: http://svn.viney.net.nz/things/rails/plugins/active_recor…
jonathan authored
10 http://www.paypal.com/cgi-bin/webscr?cmd=_send-money
11
12 Email address: jonathan.viney@gmail.com
0bfeb6b git-svn-id: http://svn.viney.net.nz/things/rails/plugins/active_recor…
jonathan authored
13
14 == Instructions
d7c2d11 git-svn-id: http://svn.viney.net.nz/things/rails/plugins/active_recor…
jonathan authored
15
16 Allow you to easily specify default values for attributes on new model objects. Eg:
17
10bce13 git-svn-id: http://svn.viney.net.nz/things/rails/plugins/active_recor…
jonathan authored
18 class Person < ActiveRecord::Base
b7e1977 git-svn-id: http://svn.viney.net.nz/things/rails/plugins/active_recor…
jonathan authored
19 defaults :country => 'New Zealand', :type => 'Unknown', :address => proc { Address.new }
d7c2d11 git-svn-id: http://svn.viney.net.nz/things/rails/plugins/active_recor…
jonathan authored
20
21 default :last_name do |person|
22 person.first_name
23 end
24 end
25
b7e1977 git-svn-id: http://svn.viney.net.nz/things/rails/plugins/active_recor…
jonathan authored
26 The default value is only used if the attribute is not present in the attributes hash.
10bce13 git-svn-id: http://svn.viney.net.nz/things/rails/plugins/active_recor…
jonathan authored
27
b7e1977 git-svn-id: http://svn.viney.net.nz/things/rails/plugins/active_recor…
jonathan authored
28 See active_record_defaults.rb for full documentation.
d7c2d11 git-svn-id: http://svn.viney.net.nz/things/rails/plugins/active_recor…
jonathan authored
29
30 == Installation
31
5c8ca5a git-svn-id: http://svn.viney.net.nz/things/rails/plugins/active_recor…
jonathan authored
32 script/plugin install http://svn.viney.net.nz/things/rails/plugins/active_record_defaults
d7c2d11 git-svn-id: http://svn.viney.net.nz/things/rails/plugins/active_recor…
jonathan authored
33
34 == Help
35
36 Feel free to email with any problems, suggestions, bugs etc...
37
38 jonathan dot viney @ gmail . com
Something went wrong with that request. Please try again.