Acts as Changed plugin

Plugin details

Specifies only the changed fields when updating the database record.

Repositoryhttp://svn.viney.net.nz/things/rails/plugins/acts_as_changed/ Author Jonathan Viney Tags ActiveRecord LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://svn.viney.net.nz/things/rails/plugins/acts_as_changed/
    p = people(:jonathan)
    
    assert_equal [], p.changed_attributes
    
    # Handed back a copy of the instance variable
    p.changed_attributes << 'should be added to duplicate'
    assert_equal [], p.changed_attributes
    
    # Attributes should only appear once in changed_attributes
    p.name = 'Captain Comic'
    assert_equal ['name'], p.changed_attributes
    p.name = 'Captain Comic 2'
    assert_equal ['name'], p.changed_attributes

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 10 months ago