Redmine Refactor #106: Move method from ProjectsController#reset_activities to ProjectEnumerationsController#destroy

In today’s refactoring, I finished up refactoring ProjectsController to ProjectEnumerationsController. Using move method I moved #reset_activities to ProjectEnumerationsController and renamed it to #destroy.

Before

1
2
3
class ProjectsController  'projects', :action => 'settings', :tab => 'activities', :id => @project
  end
end
1
2
class ProjectEnumerationsController < ApplicationController
end

After

1
2
3
class ProjectsController < ApplicationController
  # Removed reset_activities method
end
1
2
3
class ProjectEnumerationsController  'projects', :action => 'settings', :tab => 'activities', :id => @project
  end
end

With this refactoring complete, ProjectsController is almost ready to be converted to a REST resource. There are three more methods that I think should be merged into other methods (#modules, #archive, and #unarchive) and then some more methods that should be split (#edit to #edit and #update).

Reference commit

Share

  • Facebook
  • Twitter
  • HackerNews
  • Reddit
  • Tumblr
  • Delicious
  • Email
  • RSS

Related posts:

  1. Daily Refactor #54: Move Method to KanbanPane
  2. Daily Refactor #53: Move Method to KanbanPane
  3. Daily Refactor #31: Extract Method in IssuesHelper#show_detail
  4. Daily Refactor #30: Move Method into Issue
  5. Daily Refactor #8: Move method in the ReportsController

About Eric Davis

I founded Little Stream Software where I provide Redmine and ChiliProject services to help projects teams. I also created an ebook, Redmine Tips, were I show you how to become more productive using Redmine. I am also the author of Refactoring Redmine, where I go about refactoring Rails using Redmine as an example.

, , ,

Chirk HR     Reuse your existing job applicants »
WP Socializer Aakash Web