jeudi 24 septembre 2015

RubyMine inline refactoring?

Here is some long-form code:

  c.jobs.each do |j|
    j.products.each do |p|
      p.destroy
    end
    j.payments.each do |p|
      p.destroy
    end
    j.destroy
  end

RubyMine has an inline refactoring tool, but it's disabled when I try to refactor any part of this.

I would expect to be able to click on the do by products and inline refactor to:

j.products.each { |p| p.destroy }

In a single keystroke.

What am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire