Module | ActiveRecord::Userstamp
In: | lib/userstamp.rb

Active Records will automatically record the user who created and/or updated a database objects if fields of the names created_by/created_by are present.

This module requires that your user object (which by default is `User` but can be changed using the `user_model_name` method) contains an accessor called `current_user` and is set with the instance of the currently logged in user (typically using a `before_filter` and the session.

The functionality can be turned off on a case by case basis by setting the `record_userstamps` property of your ActiveRecord object to false.

### Methods

create_with_user included update_with_user

### Public Class methods

included(base)

### Public Instance methods

create_with_user()

This method is an alias for the normal `create` method. This is where we set the `created_by` and `updated_by` attributes. This only happens if the attributes exist for the model, the `record_userstamps` attribute is true, and the user model has the `current_user` set.

After we update those attributes we continue by running the normal `create` method where the object is actually validated and saved.

update_with_user()

This method is an alias for the normal `update` method. This is where we set the `updated_by` attribute. This only happens if the attributes exist for the model, the `record_userstamps` attribute is true, and the user model has the `current_user` set.

After we update those attributes we continue by running the normal `update` method where the object is actually validated and saved.

[Validate]