# File lib/has_many_polymorphs/debugging_tools.rb, line 56
      def method_missing(method_name, *args, &block)
        if COLLECTION_METHODS.include? method_name.to_sym
          Dir.chdir GENERATED_CODE_DIR do
            filename = "#{demodulate(self.name.underscore)}.rb"
            contents = File.open(filename).read rescue "\nclass #{self.name}\n\nend\n"
            callfile, callline = caller[2][%r!/.*/(.*?:\d+)!, 1].split(':')
            contents[-5..-5] = "\n  #{method_name} #{args[0..-2].inspect[1..-2]},\n     #{args[-1].inspect[1..-2].gsub(" :", "\n     :").gsub("=>", " => ")}\n#{ block ? "     #{block.inspect.sub(/\@.*\//, '@')}\n" : ""}     # called from #{callfile}, line #{callline}\n\n"
            File.open(filename, "w") do |file|
              file.puts contents
            end
          end
          # doesn't actually display block contents
          self.send("original_#{method_name}", *args, &block)
        else
          self.send(:original_method_missing, method_name, *args, &block)
        end
      end