diff options
Diffstat (limited to 'rubocop')
-rw-r--r-- | rubocop/cop/migration/add_limit_to_text_columns.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/rubocop/cop/migration/add_limit_to_text_columns.rb b/rubocop/cop/migration/add_limit_to_text_columns.rb index 5c71fbbfaa2..2d3b5d5094f 100644 --- a/rubocop/cop/migration/add_limit_to_text_columns.rb +++ b/rubocop/cop/migration/add_limit_to_text_columns.rb @@ -44,11 +44,9 @@ module RuboCop if text_operation_with_limit?(send_node) add_offense(send_node.loc.selector, message: TEXT_LIMIT_ATTRIBUTE_NOT_ALLOWED) if version(node) < TEXT_LIMIT_ATTRIBUTE_ALLOWED_SINCE - else + elsif text_limit_missing?(node, *table_and_attribute_name(send_node)) # We require a limit for the same table and attribute name - if text_limit_missing?(node, *table_and_attribute_name(send_node)) - add_offense(send_node.loc.selector) - end + add_offense(send_node.loc.selector) end end end |