Skip to content

Freelancing Digest

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

Redmine Refactor #120: Move Method from NewsController to CommentsController

Since I created the CommentsController yesterday, today I’m going to move the #destroy_comment method over to it. I also threw in a bit of rename method magic to make it match the RESTful naming conventions. Before 1 2 3 class NewsController 'show', :id => @news end endclass NewsController 'show', :id => @news end end 1 …

Read more

  • move-method
  • redmine
  • refactoring
  • rename-method
  • ruby

Redmine Refactor #119: Extract Class from NewsController

Now that I’ve refactored many of the standard REST methods in NewsController, I need to work on the non-standard ones. There are two which really bother me, #add_comment and #destroy_comment. If your controllers have actions that include the name of a different model, there is a good chance that a extract class needs to happen. …

Read more

  • extract-class
  • redmine
  • refactoring
  • ruby

Redmine Refactor #118: Split Edit Method in NewsController

Following up to yesterday’s refactoring of NewsController#new, today I’m using split method again but on #edit. #edit is both rendering the form for editing a news item as well as accepting the form submission and saving it to the database. To work with RESTful Rails, it needs to be split into #edit and #update. Before …

Read more

  • extract-method
  • redmine
  • refactoring
  • ruby
  • split-method

Refactoring Redmine covered on The Ruby Show

Dan Benjamin and Jason Seifer talked about the Refactoring Redmine in the 133rd episode of the Ruby Show. It’s around the 12 minute mark.

Read more

  • redmine
  • refactoring
  • ruby

Redmine Refactor #117: Split New Method in NewsController

Now that IssuesController, ProjectsController, and VersionsController have been refactored to resources, I’m moving on to the NewsController. This controller suffers from the same problem that the other ones did, using the #new and #edit actions for two different purposes. Using split method, I can start to separate these actions and start to convert NewsController to …

Read more

  • extract-method
  • redmine
  • refactoring
  • ruby
  • split-method
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: