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 …
Tag: extract-method
Redmine Refactor #136: Extract Method date_index in WikiController#special
As a follow up to last Friday’s refactoring of WikiController#special, today I used extract method to remove the date_index method. Before 1 2 3 4 5 6 7 8 9 10 class WikiController 'export', :id => @project # Compatibility stub while refactoring return else # requested special page doesn't exist, redirect to default page redirect_to …
Redmine Refactor #135: Extract Method page_index in WikiController#special
With the #load_pages_grouped_by_date_without_content method extracted in WikiController#special from yesterday, I can now get back to splitting up #special. Before 1 2 3 4 5 6 7 8 9 10 class WikiController 'export', :id => @project # Compatibility stub while refactoring return else # requested special page doesn't exist, redirect to default page redirect_to :action => …
Redmine Refactor #134: Extract Method in WikiController#special to utility method
I’m still working on refactoring that case statement in WikiController#special but before I can extract the next actions (page_index,date_index), I need to refactor some of it’s inner logic. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 class WikiController "#{WikiPage.table_name}.*, #{WikiContent.table_name}.updated_on", :joins => "LEFT JOIN #{WikiContent.table_name} ON …
Redmine Refactor #133: Extract Method in WikiController#special
I started trying to refactor the routes.rb for Redmine in order to nest the resources and remove some duplication. Unfortunately, I kept running into trouble and had to scrap that plan. So instead I decided to continue on with my controller refactoring and try to improve things there first. Using the wc technique I wrote …