lib/rubocop/cop/rails/inquiry.rb in rubocop-rails-2.8.1 vs lib/rubocop/cop/rails/inquiry.rb in rubocop-rails-2.9.0

- old
+ new

@@ -20,18 +20,19 @@ # # # good # pets = %w(cat dog) # pets.include? 'cat' # - class Inquiry < Cop + class Inquiry < Base MSG = "Prefer Ruby's comparison operators over Active Support's `inquiry`." + RESTRICT_ON_SEND = %i[inquiry].freeze def on_send(node) - return unless node.method?(:inquiry) && node.arguments.empty? + return unless node.arguments.empty? return unless (receiver = node.receiver) return if !receiver.str_type? && !receiver.array_type? - add_offense(node, location: :selector) + add_offense(node.loc.selector) end end end end end