Looking through Redmine’s ProjectsController, I found a few actions that were being used to manage project files. These files are separate resources on a project so using move method and extract class I created a new controller, FilesController. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 class ProjectsController …
Tag: ruby
Redmine Refactor #102: Move method from ProjectsController#roadmap to VersionsController#index
The next refactoring I performed on Redmine’s ProjectsController was to move the #roadmap method to VersionsController. The #roadmap is used to list all Versions on a project. Since that fits Rails’ RESTful conventions for #index, I used move method to move it to the VersionsController. Before 1 2 3 4 5 6 7 8 9 …
Redmine Refactor #101: Extract activity from ProjectsController to a new controller
Starting on my refactoring of Redmine’s ProjectsController, I used extract class to move the #activity method to a new controller. #activity is used to get a timeline of events on a project, so you can see what’s recently happened. Since it’s not tied to an actual project record, it doesn’t fit on ProjectsController. Before 1 …
Problems when you don’t Refactor Rails: Lower Participation
Another problem unfactored code causes with open source Rails projects, is lower participation. Before getting into that, why do we even care about project participation? Why participation matters Lower participation in open source projects can kill it. Developers care about code quality and will leave if the quality gets too low. Users don’t care about …
Redmine Refactor #100: Convert Issue Routes to REST Resources
For my 100th refactoring of Redmine, I decided to go big. Today I refactored Redmine’s Issue routes from standard Rails routes to actual REST resources. 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 …