Comments (7)
Possible fix: change it to a before_destroy rather than an after_destroy operation, so the create() call occurs on an object that exists.
from audited.
I am also getting this error since Rails 3.0.3. Could you please elaborate a bit where to make the mentioned changes?
from audited.
see my pull request in issue 36
from audited.
ah, thank you. This bug is now gone. But I am still getting the mass assign of protected attributes error.
from audited.
Also fixed in part by bb38256.
from audited.
I am still getting this exact same error. I am using rails 3.0.5 and acts_as_audited 2.0.0.rc7
Here is the trace I get:
activerecord (3.0.5) lib/active_record/associations/association_collection.rb:551:in `ensure_owner_is_not_new'
activerecord (3.0.5) lib/active_record/associations/association_collection.rb:495:in `create_record'
activerecord (3.0.5) lib/active_record/associations/association_collection.rb:271:in `create'
acts_as_audited (2.0.0.rc7) lib/acts_as_audited/auditor.rb:215:in `write_audit'
acts_as_audited (2.0.0.rc7) lib/acts_as_audited/auditor.rb:209:in `audit_destroy'
activesupport (3.0.5) lib/active_support/callbacks.rb:414:in `_run_destroy_callbacks'
activerecord (3.0.5) lib/active_record/callbacks.rb:260:in `destroy'
activerecord (3.0.5) lib/active_record/transactions.rb:235:in `destroy'
activerecord (3.0.5) lib/active_record/transactions.rb:292:in `with_transaction_returning_status'
activerecord (3.0.5) lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
activerecord (3.0.5) lib/active_record/transactions.rb:207:in `transaction'
activerecord (3.0.5) lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
activerecord (3.0.5) lib/active_record/transactions.rb:235:in `destroy'
from audited.
https://github.com/collectiveidea/acts_as_audited/pull/79
This fixes it for my case, which is a form that removes duplicate entries before they even get saved.
from audited.
Related Issues (20)
- Using audited in Rails 7.0.7 generates a lot of deprecation warnings HOT 3
- created_at value has the timezone offset applied twice (>= 5.0.0)
- Readonly attributes are registered as modified HOT 1
- Rails 7.1.beta.1 - DEPRECATION WARNING: Module.deprecate without a deprecator is deprecated HOT 1
- Exclude Audited Gem Log Entries from PostgreSQL Database Storage
- Encryption for audited_changes / disabling the FILTERED feature HOT 3
- Audits with line of code location HOT 1
- Different kinds of User. HOT 2
- Updating an enum field on audited record while updating nested resource with touch: true creates a double audit
- `#touch` on record results in `NoMethodError` HOT 1
- Conditionally turn off audits in tests
- Auditing models with a Composite Primary Key - possible? HOT 1
- Ignoring deleted_at/deleted_on attributes
- Support for batch creation of audits HOT 2
- Support for BigInt HOT 1
- How to ignore impersonated user ?
- Specify action
- Add YAML safe load documentation
- Gem is not saving auditable_id, auditable_type for User model
- When combining old audits, oldest value should be kept
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audited.