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
12
votes
6 answers

ActionController::InvalidAuthenticityToken Rails 5 / Devise / Audited / PaperTrail gem

Background Details I am using Devise for authentication to login to a Rails 5 application. Whenever I bundle either the Audited or Paper Trail gem, when I attempt to #create a new session (via the sign in form - /users/sign_in), I receive the…
aldefouw
  • 533
  • 1
  • 4
  • 12
8
votes
2 answers

Audited Gem current_user_method not working

I am using the Audited gem in my application for tracking user log. Everything is working fine except for current user tracking. In my case, I have 2 models: Instructor and Student. Instructor will be the current_admin_user, and I need to find the…
Vishal
  • 7,113
  • 6
  • 31
  • 61
6
votes
2 answers

Rails - Save tenant in Audited (formerly acts_as_audited)

I have Audited (formerly acts_as_audited) setup and working. The user_id is successfully saved in the audit table but I can't figure out an efficient way to save the tenant_id (I have multitenancy setup with scopes). I have tried using the…
Marklar
  • 1,247
  • 4
  • 25
  • 48
6
votes
3 answers

audited, Look up audits belonging to a user

I am using audited to track changes for a model called Page. I would like to be able to find all audits associated with a certain user (via user_id in the audits table). How can I do that? So far, the only way I have found to access the Audit…
Jay
  • 2,861
  • 3
  • 29
  • 51
4
votes
1 answer

Rails 3 - Devise with acts_as_audited possible?

I'd like to use Devise with acts_as_audited. I have googled it, but the results weren't very clear. What are its pros and cons?
Rashmi
  • 629
  • 1
  • 11
  • 35
4
votes
2 answers

Rails 5 - view changes using Audited gem

In my app that I build to learn RoR, I want to add change tracking and use the Audited gem for that. While it is clear how to add it to my models, how can I see the changes? I would want to add a link / button on each page for the different objects…
Dimitri de Ruiter
  • 725
  • 2
  • 7
  • 26
3
votes
4 answers

Rails - Devise and acts_as_audited

Hey, I want to use Devise and acts_as_audited together but when I try and link them using - class ApplicationController < ActionController::Base audit Candidate protected def current_user @user = User.find(user_session) end I get this…
Alex
  • 6,205
  • 7
  • 43
  • 53
3
votes
1 answer

How to make a plain ruby object assignable as active record association

I have an Audit class which is backed by ActiveRecord. class Audit < ActiveRecord::Base belongs_to :user, polymorphic: true end I have a User class which is a plain ruby object with some ActiveModel functionality included. It's not a database…
David Tuite
  • 22,258
  • 25
  • 106
  • 176
2
votes
0 answers

rails duplicate insertion with nested forms

I have a model where a group has several capabilities class Group < ActiveRecord::Base attr_accessible :capabilities_attributes acts_as_audited #<------------------------------- source of error has_associated_audits has_many :capabilities,…
2
votes
1 answer

Audited Gem: tracking through multiple relationships

Looking for the right way to setup audited associated_with and has_associated_audits in my models its easier to track. The Setup: Publisher has exclusive dealer with Authors. An author can write many books. A Book can have many writers. A Book has…
cal1801
  • 135
  • 1
  • 11
2
votes
0 answers

auditable_id is going nil when using Audited

I'm using Audited gem for rails and auditing reocrds for one of my model and everything works fine but auditable_id is going nil in audits table. This is happening because id of the object i'm auditing is int and audits table store auditable_id as…
Manoj
  • 68
  • 1
  • 6
2
votes
1 answer

How can I debug a gem in Rails?

I'm attempting to start my rails server, but I'm getting the error trace below. I've commented out the line mentioned here: 4.2.0/lib/audited/auditor.rb:48:in `audited' from /home/david-vm/Documents/rails_projects/bane/app/models/user.rb:9:in…
daveomcd
  • 6,367
  • 14
  • 83
  • 137
2
votes
1 answer

Gem "audited-activerecord", "~> 4.0 gives undefined method `audits'

I am using: Rail 4.1.7 Ruby 2.1.4 I just installed Audited GEM: gem "audited-activerecord", "~> 4.0" $ rails generate audited:upgrade $ rake db:migrate Model class Opportunity < ActiveRecord::Base ... audited ... end And when I…
Lut
  • 1,363
  • 1
  • 14
  • 30
2
votes
1 answer

Ruby on Rails: RSpec and Acts As Audited (disabling acts_as_audited while testing?)

I've been getting an error, which I think could be solved by disabling acts_as_audited when running tests, or at least stubbing current_user in audit sweeper. The error is below. What do you think I should do? NoMethodError in 'Order should create a…
Ramon Tayag
  • 15,224
  • 9
  • 43
  • 69
1
vote
1 answer

how to get the difference between old value and new value in ruby

I'm using acts_as_audited gem in Ruby it works fine. When I created, updated or deleted the model, it capture the changes into an audits table. When updating models it shows the old value and new value in single column in audits table. For…
user1094976
1
2 3 4