Browse Source

Maintenance: Bump rubocop-rails from 2.12.4 to 2.13.0

Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.12.4 to 2.13.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.12.4...v2.13.0)
Martin Gruner 3 years ago
parent
commit
6714b5f1a4

+ 4 - 0
.rubocop/default.yml

@@ -189,6 +189,10 @@ Rails/SkipsModelValidations:
     - "**/*_spec.rb"
     - "**/*_examples.rb"
 
+Rails/ReversibleMigration:
+  Description: This cop checks whether the change method of the migration file is reversible.
+  Enabled: false
+
 Style/ClassAndModuleChildren:
   Description: 'Checks style of children classes and modules.'
   Enabled: false

+ 2 - 2
Gemfile.lock

@@ -523,7 +523,7 @@ GEM
     rubocop-performance (1.13.1)
       rubocop (>= 1.7.0, < 2.0)
       rubocop-ast (>= 0.4.0)
-    rubocop-rails (2.12.4)
+    rubocop-rails (2.13.0)
       activesupport (>= 4.2.0)
       rack (>= 1.1)
       rubocop (>= 1.7.0, < 2.0)
@@ -644,7 +644,7 @@ GEM
     writeexcel (1.0.5)
     xpath (3.2.0)
       nokogiri (~> 1.8)
-    zeitwerk (2.5.1)
+    zeitwerk (2.5.2)
     zendesk_api (1.33.0)
       faraday (>= 0.9.0, < 2.0.0)
       hashie (>= 3.5.2, < 5.0.0)

+ 2 - 2
app/controllers/application_controller/handles_devices.rb

@@ -24,9 +24,9 @@ module ApplicationController::HandlesDevices
 
     if user_device_updated_at
       # check if entry exists / only if write action
-      diff = Time.zone.now - 10.minutes
+      diff = 10.minutes.ago
       if %w[GET OPTIONS HEAD].include?(request.method)
-        diff = Time.zone.now - 30.minutes
+        diff = 30.minutes.ago
       end
 
       # only update if needed

+ 2 - 2
app/controllers/monitoring_controller.rb

@@ -34,7 +34,7 @@ curl http://localhost/api/v1/monitoring/health_check?token=XXX
     actions = Set.new
 
     # channel check
-    last_run_tolerance = Time.zone.now - 1.hour
+    last_run_tolerance = 1.hour.ago
     options_keys = %w[host user uid]
     Channel.where(active: true).each do |channel|
 
@@ -124,7 +124,7 @@ curl http://localhost/api/v1/monitoring/health_check?token=XXX
     end
 
     # job count check
-    total_jobs = Delayed::Job.where('created_at < ?', Time.zone.now - 15.minutes).count
+    total_jobs = Delayed::Job.where('created_at < ?', 15.minutes.ago).count
     if total_jobs > 8000
       issues.push "#{total_jobs} background jobs in queue"
     end

+ 1 - 1
app/controllers/reports_controller.rb

@@ -151,7 +151,7 @@ class ReportsController < ApplicationController
 
     case params[:timeRange]
     when 'realtime'
-      start_at = (Time.zone.now - 60.minutes)
+      start_at = 60.minutes.ago
       stop_at = Time.zone.now
       range = 'minute'
     when 'day'

+ 1 - 1
app/controllers/user_devices_controller.rb

@@ -17,7 +17,7 @@ class UserDevicesController < ApplicationController
       attributes.delete('fingerprint')
 
       # mark current device to prevent killing own session via user preferences device management
-      if session[:user_device_fingerprint] == device.fingerprint && device.updated_at > Time.zone.now - 30.minutes
+      if session[:user_device_fingerprint] == device.fingerprint && device.updated_at > 30.minutes.ago
         attributes['current'] = true
       end
       devices_full.push attributes

+ 1 - 1
app/models/channel/driver/facebook.rb

@@ -56,7 +56,7 @@ class Channel::Driver::Facebook
     # only fetch once in 5 minutes
     return true if !channel.preferences
     return true if !channel.preferences[:last_fetch]
-    return false if channel.preferences[:last_fetch] > Time.zone.now - 5.minutes
+    return false if channel.preferences[:last_fetch] > 5.minutes.ago
 
     true
   end

+ 1 - 1
app/models/channel/driver/imap.rb

@@ -437,7 +437,7 @@ returns
       Rails.logger.error e
       return true
     end
-    return true if verify_time < Time.zone.now - 30.minutes
+    return true if verify_time < 30.minutes.ago
 
     Rails.logger.info "  - ignore message #{count}/#{count_all} - because message has a verify message"
 

+ 1 - 1
app/models/channel/driver/pop3.rb

@@ -152,7 +152,7 @@ returns
       if mail.match?(%r{(X-Zammad-Ignore: true|X-Zammad-Verify: true)}) && mail =~ %r{X-Zammad-Verify-Time:\s(.+?)\s}
         begin
           verify_time = Time.zone.parse($1)
-          if verify_time > Time.zone.now - 30.minutes
+          if verify_time > 30.minutes.ago
             info = "  - ignore message #{count}/#{count_all} - because it's a verify message"
             Rails.logger.info info
             next

+ 1 - 1
app/models/channel/driver/twitter.rb

@@ -80,7 +80,7 @@ returns
     # only fetch once in 30 minutes
     return true if !channel.preferences
     return true if !channel.preferences[:last_fetch]
-    return false if channel.preferences[:last_fetch] > Time.zone.now - 20.minutes
+    return false if channel.preferences[:last_fetch] > 20.minutes.ago
 
     true
   end

Some files were not shown because too many files changed in this diff