collectiveidea / acts_as_audited
- Source
- Commits
- Network (24)
- Issues (12)
- Downloads (5)
- Wiki (1)
- Graphs
-
Branch:
master
-
There is a gemspec in repository, but gem is not being generated by github
Comments
-
wihtout "audit Model" the sweeper doesn't works
1 comment Created 3 months ago by jalberto -
Working haphazardly in production (ie config.cache_classes = true)
2 comments Created 3 months ago by joergdI declare in my application.rb:
audit User, PaymentAccount, Client, Product, Price, Contract, AssignedAdsl, ContractPrice, Role
But in production, only User, Client, Price and AssignedAdsl are audited. In development, all models are audited.
It's weird, but it's true. Does anybody know what might cause this?
Comments
-
When there are two separate controllers that audit a model, there are duplicate audits created when class caching is enabled. For example:
class PostsController < ApplicationController audit Post, :only => :create ... end class AdminController < ApplicationController audit Post ... end
Comments
acatighera
Mon Aug 17 12:26:29 -0700 2009
| link
I fixed this and sent a pull request. See: http://github.com/acatighera/acts_as_audited/commit/b803fed2776d8596ca9e90400398897f16bf0212
-
Testing with Rails 2.3.3 on Ruby 1.9 fails.
I'll be making sure it works on 1.8.6, 1.8.7 and 1.9.1 over the next few days. Any work in progress will be on my fork, in the collectiveidea branch.
http://github.com/kennethkalmer/acts_as_audited/tree/collectiveidea
Comments
-
I have audits table on a local (to rails) server and the rest of tables are located on a remote server.
I get "NoMethodError (undefined method `controller_name' for nil:NilClass)" every time I try to save or delete any record. I'm using :only => [...] param, because otherwise I get that error on every request to any resource.Removing audit from the application controller stops the error message to appear.
Comments
sorry, messed up
Not sure it will help you a lot. NoMethodError (undefined method `controller_name' for nil:NilClass): thin (1.2.2) lib/thin/connection.rb:76:in `pre_process' thin (1.2.2) lib/thin/connection.rb:74:in `catch' thin (1.2.2) lib/thin/connection.rb:74:in `pre_process' thin (1.2.2) lib/thin/connection.rb:57:in `process' thin (1.2.2) lib/thin/connection.rb:42:in `receive_data' eventmachine (0.12.8) lib/eventmachine.rb:242:in `run_machine' eventmachine (0.12.8) lib/eventmachine.rb:242:in `run' thin (1.2.2) lib/thin/backends/base.rb:57:in `start' thin (1.2.2) lib/thin/server.rb:156:in `start' thin (1.2.2) lib/thin/controllers/controller.rb:80:in `start' thin (1.2.2) lib/thin/runner.rb:174:in `send' thin (1.2.2) lib/thin/runner.rb:174:in `run_command' thin (1.2.2) lib/thin/runner.rb:140:in `run!' thin (1.2.2) bin/thin:6 /usr/local/bin/thin:19:in `load' /usr/local/bin/thin:19
OK I think I found the problem. It wasn't related to DB, it was related to sweeper and the way I use my models.
I have the plugin, in which I specify all of my models. In the init.rb I simply require all of my models so that they are loaded.
In the ApplicationController I use audit(the list of my plugin models) and get this error.
However, if I comment out the line in ActionController::Caching::Sweeper self.controller = nil in the after method - I get no error.
I guess it means I'm trying to use sweeper twice for my models in this way. -
In my application controller I have something like
audit Model1, Model2, Model3, :only => [:update, :destroy]
However, all three actions are being audited.
Looking at the code it appears that the :only option is treated in two different ways. In the acts_as_audited method, :only is used to modify the attribute list (not the actions). However in the controller/sweepers creation audit method, the :only option (and any others) is passed on to the sweepers. So, I'm not sure which way you intended this to go. It feels a little odd to have :only and :except do two totally different things, so would another option (:action?) be in order? Any other ideas or am I reading this wrong?
Rails 2.3.2
Thanks for your help!Comments
k2heikkila
Mon Jun 29 12:28:36 -0700 2009
| link
Moving this to lighthouse w/ a patch.






http://support.github.com/discussions/gems/196-what-happened-to-gems-after-the-move