Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'rubocop/cop/migration/datetime.rb')
-rw-r--r--rubocop/cop/migration/datetime.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/rubocop/cop/migration/datetime.rb b/rubocop/cop/migration/datetime.rb
index c605c8e1b6e..9cdb2d83ab5 100644
--- a/rubocop/cop/migration/datetime.rb
+++ b/rubocop/cop/migration/datetime.rb
@@ -6,7 +6,7 @@ module RuboCop
module Cop
module Migration
# Cop that checks if datetime data type is added with timezone information.
- class Datetime < RuboCop::Cop::Cop
+ class Datetime < RuboCop::Cop::Base
include MigrationHelpers
MSG = 'Do not use the `%s` data type, use `datetime_with_timezone` instead'
@@ -19,7 +19,7 @@ module RuboCop
method_name = send_node.children[1]
if method_name == :datetime || method_name == :timestamp
- add_offense(send_node, location: :selector, message: format(MSG, method_name))
+ add_offense(send_node.loc.selector, message: format(MSG, method_name))
end
end
end
@@ -34,7 +34,7 @@ module RuboCop
last_argument = descendant.children.last
if last_argument == :datetime || last_argument == :timestamp
- add_offense(node, location: :expression, message: format(MSG, last_argument))
+ add_offense(node, message: format(MSG, last_argument))
end
end
end