Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Rails/FreezeTime cop #714

Merged
merged 1 commit into from Jul 18, 2022
Merged

Commits on Jul 16, 2022

  1. Add new Rails/FreezeTime cop

    Refs: https://github.com/rubocop/rails-style-guide#freeze_time
    
    This cop Identifies usages of `travel_to` with argument current time and
    change them to use `freeze_time` instead.
    
    @example
    ```ruby
    # bad
    travel_to(Time.now)
    travel_to(DateTime.now)
    travel_to(Time.current)
    travel_to(Time.zone.now)
    travel_to(Time.now.in_time_zone)
    travel_to(Time.current.to_time)
    
    # good
    freeze_time
    ```
    ydah committed Jul 16, 2022
    Copy the full SHA
    8bedc3f View commit details
    Browse the repository at this point in the history