diff --git a/Gemfile.lock b/Gemfile.lock index 978839c..0447ffc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,7 +94,7 @@ GEM xpath (~> 2.0) climate_control (0.0.3) activesupport (>= 3.0) - cocaine (0.5.5) + cocaine (0.5.7) climate_control (>= 0.0.3, < 1.0) coderay (1.1.0) coffee-script (2.3.0) @@ -144,7 +144,7 @@ GEM mime-types (1.25.1) mini_portile (0.6.2) minitest (5.5.1) - multi_json (1.10.1) + multi_json (1.11.0) nokogiri (1.6.6.2) mini_portile (~> 0.6.0) paperclip (4.2.1) @@ -212,7 +212,7 @@ GEM rspec-mocks (~> 3.2.0) rspec-support (~> 3.2.0) rspec-support (3.2.2) - sass (3.4.12) + sass (3.4.13) sass-rails (5.0.1) railties (>= 4.0.0, < 5.0) sass (~> 3.1) diff --git a/app/controllers/cmtool/application_controller.rb b/app/controllers/cmtool/application_controller.rb index 1baeddf..54e85b9 100644 --- a/app/controllers/cmtool/application_controller.rb +++ b/app/controllers/cmtool/application_controller.rb @@ -26,6 +26,7 @@ module Cmtool current_user end end + helper_method :cmtool_user def check_environment @cmtool_warnings ||= [] diff --git a/app/helpers/cmtool/application_helper.rb b/app/helpers/cmtool/application_helper.rb index 6e2bec5..660c71b 100644 --- a/app/helpers/cmtool/application_helper.rb +++ b/app/helpers/cmtool/application_helper.rb @@ -113,6 +113,10 @@ module Cmtool format("%.2f",n) + %w(B KB MB GB TB)[count] end + def cmtool_user + controller.send :cmtool_user + end + def edit_td(obj) content_tag( :td, diff --git a/spec/dummy/app/controllers/application_controller.rb b/spec/dummy/app/controllers/application_controller.rb index 03b4e89..bffe251 100644 --- a/spec/dummy/app/controllers/application_controller.rb +++ b/spec/dummy/app/controllers/application_controller.rb @@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base private def authorize_cmtool - redirect_to new_user_session_path unless current_user.present? + redirect_to main_app.new_user_session_path unless current_user.present? end def cmtool_user