Class: RuboCop::Cop::Style::MigrationComments

Inherits:
RuboCop::Cop
  • Object
show all
Includes:
ConfigurableEnforcedStyle
Defined in:
lib/rubocop/cop/style/migration_comments.rb

Constant Summary collapse

MSG =
'Comment is obligatory.'.freeze
COMMON_DB_FIELDS =
%w(:deleted_at :id :creator_id :deleter_id :created_at :updated_at).freeze

Instance Method Summary collapse

Instance Method Details

#on_def(node) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/rubocop/cop/style/migration_comments.rb', line 12

def on_def(node)
    if node.body.type == :send
      process_block_child_node(node.body)
    else
      node.body.each_child_node do |ancestor|
        process_block_child_node(ancestor)
      end
    end
end