- Add option to use version incremented column instead of timestamps [#23]
- Add support for async audits [#20]
- Add support for Rails4 [#27]
- Add attr_accessible for Auditable::Audit model [#13]
- Add class_name option for method audit. This allows you to have a custom audit class that inherits from Auditable::Audit [#12]
- Fix a silly bug not loading the audits under the same
auditable_id
- Get the latest audit via
id DESC
instead ofcreated_at DESC
- Fix bug creating duplicate audits despite no change in a record's subsequent saves, due to using
.build
. See this comment on issue #7 - Fix bug not finding the right audit in rare cases when there are many audits with the same
created_at
timestamp
- Fix bug/inconsistency between
user
andchanged_by
, now withalias_attribute :changed_by, :user
- previously,
audit_tag_with
updates the latest audit if no changes are detected in a record's audited changes. now it creates a new audit row instead because this works better and prevent losing history if we callaudit_tag_with
multiple times. new audits are only created if the combo of 4 attributes is different:modifications
,tag
,user
,action
. - bump minor version because it is more ready for production use at this point
- Add
last_change_of(attribute)
to show the last change that happened to an attribute. Thanks to @zuf
- Fix 'Could not find generator auditable:migration' bug due to a refactoring that moved
generators
out of the/lib
folder. Moved it back
- Only create a new audit if
modifications
differ from last audit
- Fix error when calling
audit_tag_with
on a record without audits and withoutaudit_tag
virtual attribute defined.
.changed_by
,.audit_tag
,.audit_action
virtual attributes are now added to the auditable model by default. The extra checkrespond_to?
on these guys is just cumbersome to carry along.
Easier to explain with code
# Given
>> s = Survey.create :title => "something"
>> s.audits.delete_all
# Before 0.0.5
>> s.audit_tag_with("some tag") # do nothing when no audits exist
>> s.audits.empty? # => true
# From 0.0.5 onwards
>> s.audit_tag_with("some tag") # create an audit with tag if no audits exist
>> s.audits.first.tag == "some tag"