ActiveRecord Defaults plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install http://svn.viney.net.nz/things/rails/plugins/active_record_defaults/
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.
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: hardway, about 1 year ago

