While acts_as_audited
works fine with my models, I have a rake task which imports an XML file into my database. All the actions which are performed by this task (mainly create and update) are not picked up by the acts_as_audited. For the record I have added Audit.as_user(User.current_user) do; ... ; end
in the rake task file and to the class which performs the actual task.
Asked
Active
Viewed 129 times
1
2 Answers
1
Finally I got it and it was no issue with acts_as_audited
.
Apparently the Rake task which was updating the database was throwing errors. As soon as those corrected and the Task finished, I could see the audits on the tables.

Cacofonix
- 465
- 11
- 19
0
acts_as_audited works with models which is an abstract of database table. It will log the altered table/model name, current column value and modified column value. Rake Tasks are not possible to log.

Siva
- 7,780
- 6
- 47
- 54
-
Hi Shiva, thanks for the contribution. However, it is indeed possible to log the rake tasks as long as the models that the tasks are making the operations on are being audited. – Cacofonix Jul 17 '13 at 13:11