GithubHelp home page GithubHelp logo

Advenced reverting about whatwasit HOT 2 CLOSED

smpallen99 avatar smpallen99 commented on August 15, 2024
Advenced reverting

from whatwasit.

Comments (2)

smpallen99 avatar smpallen99 commented on August 15, 2024

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.

Eiji7 avatar Eiji7 commented on August 15, 2024

Yes, you're right. I edited my issue and added one more method (point 5).

from whatwasit.

Related Issues (16)

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.