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

add_column_with_default.rb « migration « cop « rubocop - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 355319b0dfe6e255ef5bfe496beacd89be8d23de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require_relative '../../migration_helpers'

module RuboCop
  module Cop
    module Migration
      class AddColumnWithDefault < RuboCop::Cop::Cop
        include MigrationHelpers

        MSG = '`add_column_with_default` is deprecated, use `add_column` instead'.freeze

        def on_send(node)
          return unless in_migration?(node)

          name = node.children[1]

          add_offense(node, location: :selector) if name == :add_column_with_default
        end
      end
    end
  end
end