Comments (2)
Yes, I was thinking of adding revert support at some time. Couple notes:
- I find revert_by_assocation(s) a little confusing. Perhaps revert_by_whodoneit(s)??
- These functions should be added to the generated Version model.
Steve
On Aug 24, 2016, at 8:11 AM, Eiji7 [email protected] wrote:
These methods can be useful:
revert_last_version - reverts last change (only update) - returns tuple: {:ok, version} or raise Whatwasit.NoUpdateVersionError
revert_to_version - revert all changes from X version
revert_by_associations
revert_by_association - calls: revert_by_associations([association])
For 3rd and 4th point:
revert all changes made by User(s)
returns tuple: {:ok, versions} or {:error, associations} or raise Whatwasit.NoUpdateVersionError
where: associations is User Enum that made changes after one or more changes made by selected association(s)
Optionally: force parameter that not return error tuple and delete all versions (from selected associations first update version).This can be done in optional module:
defmodule MyProject.Post do
use Whatwasit
use Whatwasit.Revert
# ...
end
Maybe optionally add is_deleted field for Version (to preview admin activity)? What do you think about it?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub #12, or mute the thread https://github.com/notifications/unsubscribe-auth/AA2YpTwSXlFhhKM3ISgLm1kAVgma1Zplks5qjDTsgaJpZM4Jr8CD.
from whatwasit.
Yes, you're right. I edited my issue and added one more method (point 5).
from whatwasit.
Related Issues (16)
- User model should be an option
- Add map for additional data e.g data of request HOT 6
- Diff support for String HOT 2
- Add log file support (fail2ban and other log tools) HOT 1
- Story only changed fields in object HOT 4
- Question: why migration and model are generated? HOT 3
- Fork: Refactor and simplify code HOT 10
- Auditing branch doesnt work with --whodoneit-map HOT 1
- Support a user model that is not an Ecto model
- installation error
- Only works with integer ids, would be nice to make it work with UUID
- Violation of changeset design principals? HOT 9
- Track creates HOT 5
- Default parameter specifier of changeset function in output of command "mix whatwasit.install" HOT 2
- Conflicts with local function HOT 2
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 whatwasit.