Git Product home page Git Product logo

Comments (7)

dgm avatar dgm commented on June 27, 2024

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.

 avatar commented on June 27, 2024

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.

dgm avatar dgm commented on June 27, 2024

see my pull request in issue 36

from audited.

 avatar commented on June 27, 2024

ah, thank you. This bug is now gone. But I am still getting the mass assign of protected attributes error.

from audited.

kennethkalmer avatar kennethkalmer commented on June 27, 2024

Also fixed in part by bb38256.

from audited.

scnaegle avatar scnaegle commented on June 27, 2024

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.

scnaegle avatar scnaegle commented on June 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.