]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user_block.rb
Fix rubocop Rails/TimeZone warnings
[rails.git] / app / models / user_block.rb
index 46a8c282b3c18ba8d3b10f9554fe54cde8a1f8ae..7af1f9bdc2d009a562bb910a6d560c6e7ae1846a 100644 (file)
@@ -37,7 +37,7 @@ class UserBlock < ApplicationRecord
   ##
   # scope to match active blocks
   def self.active
-    where("needs_view or ends_at > ?", Time.now.getutc)
+    where("needs_view or ends_at > ?", Time.now.utc)
   end
 
   ##
@@ -50,7 +50,7 @@ class UserBlock < ApplicationRecord
   # returns true if the block is currently active (i.e: the user can't
   # use the API).
   def active?
-    needs_view || ends_at > Time.now.getutc
+    needs_view || ends_at > Time.now.utc
   end
 
   ##
@@ -65,7 +65,7 @@ class UserBlock < ApplicationRecord
   # is the user object who is revoking the ban.
   def revoke!(revoker)
     update(
-      :ends_at => Time.now.getutc,
+      :ends_at => Time.now.utc,
       :revoker_id => revoker.id,
       :needs_view => false
     )