You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: expanded_date_range.rb
    path of file: ./repos/rubocop-rails/lib/rubocop/cop/rails
    
    the code of the file until where you have to start completion: # frozen_string_literal: tru
    
        def on_irange(node)
          begin_node = node.begin
          end_node = node.end
          return if allow?(begin_node, end_node)

          preferred_method = preferred_method(begin_node)
          if begin_node.method?(:beginning_of_week) && begin_node.arguments.one?
            return unless same_argument?(begin_node, end_node)

            preferred_method << "(#{begin_node.first_argument.source})"
          elsif any_arguments?(begin_node, end_node)
            return
          end