Comments (5)
And if you move store_in
above that track_history
does it change anything? Either way I think it's a bug and the scope should include the target collection. Try PRing a full spec and maybe a fix, I can try helping with that too.
from mongoid-history.
@dblock yes, that fixes it. I can PR a fix that substitutes class name as the key instead of collection, but the tests wont pass. The other solution I was thinking is to store the options on the class itself but I think that messes with inheritance.
The end goal is to have a set-and-forget module that can be included anywhere, and ideally everywhere to track every change.
from mongoid-history.
I think storing options on the class itself is the way to go, and it can use class level attributes that are copied on inheritance but become local to the child class when modified. I am not saying it's easy, but you'll be my hero if you can make it work :)
from mongoid-history.
It's going to break some tests. I'll code it up and report back.
from mongoid-history.
Closed via #227
from mongoid-history.
Related Issues (20)
- Restrict dependency failure does not prevent history entry creation
- Unable to Contribute HOT 1
- undefined method `[]' for #<..::EmbedsMany> HOT 7
- Compatibility with Mongoid 7 HOT 4
- Specs create classes and are order-dependent
- Fix undo and redo modifier on embedded create/destroy
- Fix inheritance of history_trackable_options HOT 4
- Release v. Next HOT 1
- `HistoryTracker` documents not created if `track_create` set to `false` HOT 2
- undefined method `collection_name' for nil:NilClass Did you mean? collectionize error coming HOT 6
- History tracker recording undo action as the last change.. HOT 1
- wrong number of arguments HOT 14
- Adding custom attributes before save HOT 1
- A tracker on an embeds_many relation is being limited by the parent configuration HOT 1
- Embeds many tracking fails if original value is `nil`
- How can we track changes done with set method? HOT 1
- It should not warn about `Overwriting existing field version` when `track_history` is called more than once
- Is it possible to specify a max number of history_tracks to maintain for each document? HOT 1
- How to get what the collection looked like on a version? HOT 3
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 mongoid-history.