After thinking about the REST API I want for WikiController, I decided that it needs to have an #index action so the user can get a list of the wiki pages. Looking over the actions, I found #page_index was already doing this so I used rename method to convert it over to #index. Before 1 …
Category: Articles
Redmine Refactor #140: Extract Method WikiController#edit to #update
Digging into the next method in WikiController, I found that the #edit method is doing way too much. render a form for new wiki page render a form for editing an existing wiki page render a form for rolling back a wiki page creating a new wiki page updating an existing wiki page updating an …
Redmine Refactor #139: Rename WikiController#index method to WikiController#show
Today’s refactoring is a pretty simple code change but it has some far reaching impact. While reviewing WikiController‘s refactoring to a REST resource, I noticed that the #index action is being used to show a single WikiPage. So using a simple rename method, I changed this to the standard #show. Before 1 2 3 4 …
Interested in seeing how I fix bugs and add features in Redmine?
I’ve been doing a lot of posts on Refactoring Redmine lately (and even wrote the book on it), but I’ve been wondering… Would anyone be interested in seeing how I fix bugs and add features to Redmine? Just add a comment below or reply to me on Twitter @edavis10. Eric Davis
Redmine Refactor #138: Unify Interfaces
Today’s refactoring is a bit different. I’ve noticed a code smell in WikiController that I wanted to fix before I got into it’s other actions. WikiController is working with the WikiPage model pretty intimately. The naming mismatch isn’t the problem though, the problem is with the parameter names that are passed around. :id – the …