Questions tagged [acts-as-audited]

Audited (formerly acts_as_audited) is an ORM extension that logs all changes to your Rails models.

(formerly acts_as_audited) is an extension that logs all changes to your Rails models.

60 questions
1
vote
1 answer

SystemStackError - stack level too deep; in Rspec test, using acts_as_audited, Rspec, Database cleaner

I ran into a strange infinite recursion that appears only in an Rspec test. Oddly, this was caused by adding auditing to my User object, even though the spec that it is failing on is not actually related to my User object Here's the test it was…
Jason FB
  • 4,752
  • 3
  • 38
  • 69
1
vote
2 answers

How can I add a print method for Audited gem in Rails?

I'm using the gem Audited in my Rails app. I want to create a way to print out the Audit record so I can have a feed of what has been changed by a User, or what has changed on an object. Currently, I have setup a method called print_audit on each…
daveomcd
  • 6,367
  • 14
  • 83
  • 137
1
vote
2 answers

Auditing Records In Rails

I have a Rails 3.2.14 app which has a Call model with many different associations. I want to be able to track changes to the Call model and somehow display a list of changes in the the Call Show View. I've been reading about the audited gem which…
nulltek
  • 3,247
  • 9
  • 44
  • 94
1
vote
1 answer

Audited: undefined method `associated' for nil:NilClass

So I have a Entry model with a column called created_by which I would like to default to the first User who created the entry. I installed audited and in my Entry model I have: belongs_to :user audited :associated_with => :user Similarly in my User…
Thalatta
  • 4,510
  • 10
  • 48
  • 79
1
vote
2 answers

Can I use acts_as_audited in a rake task?

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…
Cacofonix
  • 465
  • 11
  • 19
1
vote
3 answers

Audited audited_changes confusion

Im using collectiveidea's audited solution for auditing in rails. So, there's a column (audited_changes) that is a TEXT definition in the database. When i retrieve an audit from the database, i get a plain string, and when i call that attribute in…
damuz91
  • 1,461
  • 2
  • 21
  • 37
1
vote
2 answers

Custom Named Attributes in Rails

Is it possible in ActiveRecord to customize/override the name of an attribute so that it does not match the column name in the database? My specific case involves a legacy column, "revision", that I can't remove at this time. The column name…
catalpa
  • 1,902
  • 2
  • 15
  • 16
0
votes
0 answers

is it possible to not save record in audit table?

I don't want to save in case when data the same in audit table new record, but anyway it saves changes in two tables and updates modifiedAt. Is there anything to avoid this…
0
votes
1 answer

Any examples of using Sinatra with acts_as_audited?

background: I am building a web app using Sinatra and ActiveRecord and I am keen to take advantage of acts_as_audited (as per https://github.com/collectiveidea/acts_as_audited). The docs for acts_as_audited assume I'll be using Rails and so assume…
Dave Sag
  • 13,266
  • 14
  • 86
  • 134
0
votes
1 answer

LIKE in .where with audited gem

I would like find audited changes of state but i dont know who find audited changes from any states I try this and its work but i would like find last audited change from any states to offboarded: product.audits.where("audited_changes LIKE…
Wako
  • 140
  • 1
  • 15
0
votes
1 answer

User_id and user_type is NULL using gem audited

I have a problem with an audited gem. It's two problems in one. I installed and configured the audited gem in my application, but when I delete the database and run migrate and seed again, the user_id and user_type fields in the database are NULL in…
Elton Santos
  • 571
  • 6
  • 32
0
votes
1 answer

Adding Custom Attribute In Audited Record

I want to add custom attributes in the Audit Log like first_name, last_name using audited gem. Any idea how I can update the values of my custom attributes ? #
Hassan Anwer
  • 347
  • 2
  • 14
0
votes
1 answer

Audited Gem Add Comment on Destroy

I have implemented Audited and everything works well. The only thing I can't figure out is how to add an "audit_comment" when I am deleting a record. I can successfully add it when updating or creating, but I dont see anything that would allow me to…
cal1801
  • 135
  • 1
  • 11
0
votes
1 answer

Where to list non audited columns in Rails 5.2 application with Audited gem?

I am discovering the Audited gem which brings auditing to my application with much ease. But I am still having a doubt about auditing users authentication related activities (provided by Devise). At least I'd like to remove form the log…
user1185081
  • 1,898
  • 2
  • 21
  • 46
0
votes
3 answers

make rake db:create setup another database besides development, test or production

I'm using rails 4.2 and trying to configure (in a already established application) the Audited Gem following this second database approach. My config/database.yml file was as follows: default: &default adapter: mysql2 pool: 5 timeout:…