From ddb35e06a293ea0ef748ca87fd3e4e355016af56 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Fri, 22 May 2020 23:54:14 -0400 Subject: [PATCH] Making Rubocopy happy. --- app/controllers/counter_controller.rb | 3 +++ app/helpers/application_helper.rb | 2 +- app/helpers/cluster_helper.rb | 2 ++ app/helpers/counter_helper.rb | 2 ++ lib/generators/component_generator.rb | 2 ++ test/controllers/cluster_controller_test.rb | 2 ++ test/controllers/counter_controller_test.rb | 2 ++ 7 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/controllers/counter_controller.rb b/app/controllers/counter_controller.rb index 8627d18..9b5c8a5 100644 --- a/app/controllers/counter_controller.rb +++ b/app/controllers/counter_controller.rb @@ -1,9 +1,12 @@ +# frozen_string_literal: true + class CounterController < ApplicationController before_action :associate! def show; end private + def associate! redirect_to cluster_path unless session[:cluster] end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index deacfb1..63e2bc3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,7 +2,7 @@ module ApplicationHelper def component(component_name, locals = {}, &block) - name = component_name.split("_").first + name = component_name.split('_').first render("components/#{name}/#{component_name}", locals, &block) end diff --git a/app/helpers/cluster_helper.rb b/app/helpers/cluster_helper.rb index 7b237b8..034e8dc 100644 --- a/app/helpers/cluster_helper.rb +++ b/app/helpers/cluster_helper.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + module ClusterHelper end diff --git a/app/helpers/counter_helper.rb b/app/helpers/counter_helper.rb index 0bac859..da3fcc4 100644 --- a/app/helpers/counter_helper.rb +++ b/app/helpers/counter_helper.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + module CounterHelper end diff --git a/lib/generators/component_generator.rb b/lib/generators/component_generator.rb index 2fc939d..40239ad 100644 --- a/lib/generators/component_generator.rb +++ b/lib/generators/component_generator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Generator for building scaffolding frontend components. # e.g. rails g component NAME class ComponentGenerator < Rails::Generators::Base diff --git a/test/controllers/cluster_controller_test.rb b/test/controllers/cluster_controller_test.rb index daaa651..8c40856 100644 --- a/test/controllers/cluster_controller_test.rb +++ b/test/controllers/cluster_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ClusterControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/counter_controller_test.rb b/test/controllers/counter_controller_test.rb index 7e78252..a212556 100644 --- a/test/controllers/counter_controller_test.rb +++ b/test/controllers/counter_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class CounterControllerTest < ActionDispatch::IntegrationTest