Skip to content

Commit c7d8b3e

Browse files
committed
Use each_comment_in_lines instead of deprecated API
1 parent 935ae8e commit c7d8b3e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/rubocop/cop/rails/active_record_callbacks_order.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ def begin_pos_with_comment(node)
112112
annotation_line = node.first_line - 1
113113
first_comment = nil
114114

115-
processed_source.comments_before_line(annotation_line)
116-
.reverse_each do |comment|
115+
processed_source.each_comment_in_lines(0..annotation_line).reverse_each do |comment|
117116
if comment.location.line == annotation_line && !inline_comment?(comment)
118117
first_comment = comment
119118
annotation_line -= 1

0 commit comments

Comments
 (0)