From 54f8aaa919d832dcc2a1caaf079cc3f9401b8bb9 Mon Sep 17 00:00:00 2001 From: speedy32129 Date: Thu, 30 Jun 2016 20:55:34 -0400 Subject: [PATCH] coding standards cleanup --- app/helpers/application_helper.rb | 8 +++--- config/routes.rb | 42 +++++++++++++++---------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 120d36f..bb22276 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -16,7 +16,7 @@ def status_from_id(status_id) IssueStatus.find_by_id(status_id) end - def statuses_list() + def statuses_list IssueStatus.all end @@ -26,7 +26,7 @@ def to_status_options(statuses) def new_transition_from_options(transitions) statuses = [] - for status in statuses_list() + for status in statuses_list statuses << status unless transitions.has_key?(status.id.to_s) #if !transitions.has_key?(status.id.to_s) # statuses << status @@ -35,8 +35,8 @@ def new_transition_from_options(transitions) to_status_options(statuses) end - def new_transition_to_options() - to_status_options(statuses_list()) + def new_transition_to_options + to_status_options(statuses_list) end def global_allowed_to?(user, action) diff --git a/config/routes.rb b/config/routes.rb index 959b538..428574a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,27 +1,27 @@ if Rails::VERSION::MAJOR >= 4 Rails.application.routes.draw do - match 'time_loggers/stop', :to => "time_loggers#stop", via: [:get, :post] - match 'time_loggers/start', :to => "time_loggers#start", via: [:get, :post] - match 'time_loggers/suspend', :to => "time_loggers#suspend", via: [:get, :post] - match 'time_loggers/resume', :to => "time_loggers#resume", via: [:get, :post] - match 'time_loggers/render_menu', :to => "time_loggers#render_menu", via: [:get, :post] - match 'time_loggers/add_status_transition', :to => "time_loggers#add_status_transition", via: [:get, :post] - match 'time_loggers/delete_status_transition', :to => "time_loggers#delete_status_transition", via: [:get, :post] - match 'time_loggers/show_report', :to => "time_loggers#show_report", via: [:get, :post] - match 'time_loggers/delete', :to => "time_loggers#delete", via: [:get, :post] - match 'time_loggers', :to => "time_loggers#index", via: [:get, :post] + match 'time_loggers/stop', :to => 'time_loggers#stop', via: [:get, :post] + match 'time_loggers/start', :to => 'time_loggers#start', via: [:get, :post] + match 'time_loggers/suspend', :to => 'time_loggers#suspend', via: [:get, :post] + match 'time_loggers/resume', :to => 'time_loggers#resume', via: [:get, :post] + match 'time_loggers/render_menu', :to => 'time_loggers#render_menu', via: [:get, :post] + match 'time_loggers/add_status_transition', :to => 'time_loggers#add_status_transition', via: [:get, :post] + match 'time_loggers/delete_status_transition', :to => 'time_loggers#delete_status_transition', via: [:get, :post] + match 'time_loggers/show_report', :to => 'time_loggers#show_report', via: [:get, :post] + match 'time_loggers/delete', :to => 'time_loggers#delete', via: [:get, :post] + match 'time_loggers', :to => 'time_loggers#index', via: [:get, :post] end -elsif Rails::VERSION::MAJOR = 3 +elsif Rails::VERSION::MAJOR >= 3 Rails.application.routes.draw do - match 'time_loggers/stop' , :to => "time_loggers#stop" - match 'time_loggers/start' , :to => "time_loggers#start" - match 'time_loggers/suspend', :to => "time_loggers#suspend" - match 'time_loggers/resume' , :to => "time_loggers#resume" - match 'time_loggers/render_menu', :to => "time_loggers#render_menu" - match 'time_loggers/add_status_transition', :to => "time_loggers#add_status_transition" - match 'time_loggers/delete_status_transition', :to => "time_loggers#delete_status_transition" - match 'time_loggers/show_report', :to => "time_loggers#show_report" - match 'time_loggers/delete', :to => "time_loggers#delete" - match 'time_loggers' , :to => "time_loggers#index" + match 'time_loggers/stop' , :to => 'time_loggers#stop' + match 'time_loggers/start' , :to => 'time_loggers#start' + match 'time_loggers/suspend', :to => 'time_loggers#suspend' + match 'time_loggers/resume' , :to => 'time_loggers#resume' + match 'time_loggers/render_menu', :to => 'time_loggers#render_menu' + match 'time_loggers/add_status_transition', :to => 'time_loggers#add_status_transition' + match 'time_loggers/delete_status_transition', :to => 'time_loggers#delete_status_transition' + match 'time_loggers/show_report', :to => 'time_loggers#show_report' + match 'time_loggers/delete', :to => 'time_loggers#delete' + match 'time_loggers' , :to => 'time_loggers#index' end end \ No newline at end of file