Comments (7)
@kennethkalmer, would you like us to take a stab at this? We would really like the ability to change the name of the :version attr_accessor on our models to get rid of our monkey patches. Let us know if you'd have time to accept our PR before we spend time on it. Thanks.
from audited.
Curious as to what your workaround was? I am running into the same thing.
from audited.
My workaround is to define virtual attribute "version" in the to be audited model:
def version=(value) write_attribute(:version, value) end def version read_attribute(:version) end
from audited.
I'll take a stab at this. The general assumption was that you wouldn't have a separate version column in the model you're auditing since the versioning is delegated to acts_as_audited.
from audited.
I had the version column in a model before I wanted to apply acts_as_audited. I could rename it but the above workaround could avoid code changes in many places. In the same time, I wonder if it's better not to define extra methods on a model if possible.
from audited.
I've just run into exactly the same issue. Took me a while to work out why my application stopped working after adding auditing to one of my models, but this was it - the version
method that audited added returns nil
, which breaks things.
π for not defining extra methods on the model!
from audited.
Hi there! Weβre doing some open source maintenance work and closing old issues. If you would still like this PR to be merged in, please re-open it by 2-weeks-from-today. Thanks!
from audited.
Related Issues (20)
- 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 4
- 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
- Preloading audits is ignored when accessing specific revision
- Testing the ActiveRecord version would allow to use audited without Rails. HOT 1
- Is this open? HOT 1
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.