Fix Rails/CompactBlank cop (#24690)
This commit is contained in:
parent
d00e45a7d3
commit
d902a707a3
8 changed files with 7 additions and 18 deletions
|
@ -46,7 +46,7 @@ module Attachmentable
|
|||
def set_file_extension(attachment) # rubocop:disable Naming/AccessorMethodName
|
||||
return if attachment.blank?
|
||||
|
||||
attachment.instance_write :file_name, [Paperclip::Interpolations.basename(attachment, :original), appropriate_extension(attachment)].delete_if(&:blank?).join('.')
|
||||
attachment.instance_write :file_name, [Paperclip::Interpolations.basename(attachment, :original), appropriate_extension(attachment)].compact_blank!.join('.')
|
||||
end
|
||||
|
||||
def check_image_dimension(attachment)
|
||||
|
|
|
@ -101,7 +101,7 @@ class Poll < ApplicationRecord
|
|||
end
|
||||
|
||||
def prepare_options
|
||||
self.options = options.map(&:strip).reject(&:blank?)
|
||||
self.options = options.map(&:strip).compact_blank
|
||||
end
|
||||
|
||||
def reset_parent_cache
|
||||
|
|
|
@ -445,7 +445,6 @@ class User < ApplicationRecord
|
|||
return if chosen_languages.nil?
|
||||
|
||||
chosen_languages.compact_blank!
|
||||
|
||||
self.chosen_languages = nil if chosen_languages.empty?
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue