Skip to content

Freelancing Digest

Menu
  • Past Issues
  • Articles
  • About Me
    • Hire Me
    • Contact Me

Redmine Refactor #88: Extract Method from move and perform_move

Now that #move and #perform_move are separated, I can start to refactor the duplication they share. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 class IssuesController false if …

Read more

  • extract-method
  • redmine
  • refactoring
  • ruby

Redmine Refactor #87: Extract Method Body to IssuesController#perform_move

With this refactoring I start making some major changes to IssuesController#move and #peform_move. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 class IssuesController params, :issue => issue, :target_project => @target_project, :copy => !!@copy }) if r = issue.move_to_project(@target_project, new_tracker, {:copy => @copy, :attributes …

Read more

  • extract-method
  • redmine
  • refactoring
  • ruby

Redmine Refactor #85: Extract Method in IssuesController#move

Whenever I work with legacy code I always turn to extract method and move method for most of my refactoring. Redmine’s IssuesController is no exception. Using extract method on the #move action I was able to extract several lines of code deep in the method and also remove a temporary variable. Before 1 2 3 …

Read more

  • extract-method
  • redmine
  • refactoring
  • ruby

Redmine Refactor #86: Extract Method to split IssuesController#move into two actions

Now I want to start refactoring IssuesController#move so it’s two separate actions; one to display the form and one to do the actual move. This will make adding more RESTful urls and APIs to Redmine easier. To start, I create a second method that wraps the existing #move method so I can change the routing …

Read more

  • extract-method
  • redmine
  • refactoring
  • ruby

Redmine Refactor #84: Extract Method in IssuesController#context_menu

I’m starting to refactor Redmine’s IssuesController again. It’s a very cluttered controller that hasn’t been refactored as it’s grown, so I’ll need to build up my confidence with it over the next few refactorings. To start I used extract method to pull out a new useful utility method to the ApplicationController. Before 1 2 3 …

Read more

  • extract-method
  • redmine
  • refactoring
  • ruby
Posts navigation
Newer posts
Older posts

About Eric | Twitter | Google Plus
Best of Eric Davis | Best of Freelancing | Best of Product Business | Best of Ruby and Rails Programming
Privacy Policy | Terms of Use | A Little Stream Software website

Want to transition from coder to consultant? Learn more: