GithubHelp home page GithubHelp logo

Add cooldown time about logidze HOT 3 CLOSED

palkan avatar palkan commented on July 23, 2024
Add cooldown time

from logidze.

Comments (3)

zocoi avatar zocoi commented on July 23, 2024 2

Hi all, just noticed this issue, I added a PR which is very close to this discussion: #87

from logidze.

bragovo avatar bragovo commented on July 23, 2024 1

Yeah, sorry for chaos.

# Something like -- rails g logidze:model Post --cooldown=5.minutes
# Find old yesterday record
post = Post.find(27) # v1

# Create new version at 13:01
post.update(title: 'title 1') # v2

# Rewrite v2 at 13:02
post.update(title: 'title 2') #v2

# Rewrite v2 at 13:03
post.update(title: 'title 3') #v2

# Create new version at 13:09
post.update(title: 'title 4') #v3

It will be similar to:

if post.updated_at + 5.minutes < Time.now
  Post.update(title: 'new title')
else
  Post.without_logging { Post.update(title: 'new title') }
end

from logidze.

charlie-wasp avatar charlie-wasp commented on July 23, 2024

Hi @bragovo! I am afraid, I don't understand clearly, what you want to achieve. Can you please provide a snippet with desired API usage example and comments about expected results?

from logidze.

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.