Giter Site home page Giter Site logo

rails_time_travel's Introduction

Rails Time Travel

CI RailsJazz https://www.patreon.com/igorkasyanchuk Listed on OpenSource-Heroes.com

Time travel with timecop for your Rails app (in development, staging or other env).

Very often you need to create objects or other things in the "past". With thins gem and excellent timecop gem you can freeze time to any date/time.

For developers & QA's.

Usage

Open /rails/time_travel to see

Now you can adjust the datetime. Once you are done - just reset time (you will see a red button).

Note, that this datetime change is related only to your session.

Installation

Add this line to your application's Gemfile:

group :development do
  gem 'rails_time_travel' # you can also use it on staging env or production
end

Limitations

  • this approach has all limitation which timecop has. In addition it won't work on your background jobs or SQL's with NOW(), because this gem doesn't change system time and background job is a separate process.
  • selected datetime is static, it means that value is freezed, if you need to change it you need to reset or adjust it with buttons

Contributing

  • BUNDLE_GEMFILE=gemfiles/rails_6_1.gemfile bundle exec rake test to run for Rails 6.1
  • BUNDLE_GEMFILE=gemfiles/rails_6_0.gemfile bundle exec rake test to run for Rails 6.0
  • BUNDLE_GEMFILE=gemfiles/rails_5_2.gemfile bundle exec rake test to run for Rails 5.2

TODO

  • jump to a specific datetime with datetime picker?
  • CI for Rails 4.X
  • protect with password (for example how I did in rails_performance gem)
  • go the the future?
  • make datetime not static? (use lambda)

Credits

https://stackoverflow.com/questions/32129741/can-you-use-timecop-gem-for-development-in-rails

License

The gem is available as open source under the terms of the MIT License.

rails_time_travel's People

Contributors

igorkasyanchuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rails_time_travel's Issues

Noisy log messages

Hi,
I've noticed that the log message of the running time travel is correctly logged in time_travel only when a travel is in place, but it's done unconditionally in time_travel_return. This ends up in showing TIME TRAVEL RETURN always, even when disabled.

Would it be possible to make it conditional?

I worked on a quick fix, but I had some troubles with your gemfile that references obsolete gem versions (like mimemagic 0.3.5) that cannot be added to my bundle anymore.

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.