From 0c7ca5088092d72d20566a60e24ccf0880559122 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 6 Jan 2020 22:04:47 +1300 Subject: [PATCH] small file fixes --- Guardfile | 2 ++ Rakefile | 2 ++ app/controllers/crops_controller.rb | 2 +- bin/bundle | 2 ++ bin/rails | 2 ++ bin/rake | 2 ++ bin/setup | 2 ++ bin/update | 2 ++ bin/yarn | 2 ++ config.ru | 2 ++ db/migrate/20191226024957_crop_photo_counter_cache.rb | 2 ++ script/rails | 2 ++ 12 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Guardfile b/Guardfile index e4197ab07..8e9e7cc88 100644 --- a/Guardfile +++ b/Guardfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + guard :rspec, cmd: 'bundle exec rspec --format documentation', failed_mode: :keep do diff --git a/Rakefile b/Rakefile index 15ae3eb68..88a812821 100755 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,6 @@ #!/usr/bin/env rake +# frozen_string_literal: true + # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index bbc158da3..4c6f7c0a1 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -4,7 +4,7 @@ require 'will_paginate/array' class CropsController < ApplicationController before_action :authenticate_member!, except: %i(index hierarchy search show) - load_and_authorize_resource + load_and_authorize_resource id_param: :slug skip_authorize_resource only: %i(hierarchy search) respond_to :html, :json, :rss, :csv, :svg responders :flash diff --git a/bin/bundle b/bin/bundle index f19acf5b5..2dbb71769 100755 --- a/bin/bundle +++ b/bin/bundle @@ -1,3 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) load Gem.bin_path('bundler', 'bundle') diff --git a/bin/rails b/bin/rails index 073966023..a31728ab9 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + APP_PATH = File.expand_path('../config/application', __dir__) require_relative '../config/boot' require 'rails/commands' diff --git a/bin/rake b/bin/rake index 17240489f..c19995500 100755 --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/bin/setup b/bin/setup index 94fd4d797..c2e43ceb2 100755 --- a/bin/setup +++ b/bin/setup @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require 'fileutils' include FileUtils diff --git a/bin/update b/bin/update index 58bfaed51..313c74b38 100755 --- a/bin/update +++ b/bin/update @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require 'fileutils' include FileUtils diff --git a/bin/yarn b/bin/yarn index b24854dce..268a9398f 100755 --- a/bin/yarn +++ b/bin/yarn @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + APP_ROOT = File.expand_path('..', __dir__) Dir.chdir(APP_ROOT) do exec "yarnpkg", *ARGV diff --git a/config.ru b/config.ru index bd83b2541..61c04e13f 100644 --- a/config.ru +++ b/config.ru @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) diff --git a/db/migrate/20191226024957_crop_photo_counter_cache.rb b/db/migrate/20191226024957_crop_photo_counter_cache.rb index d4a085e24..db6f6f5f9 100644 --- a/db/migrate/20191226024957_crop_photo_counter_cache.rb +++ b/db/migrate/20191226024957_crop_photo_counter_cache.rb @@ -1,5 +1,7 @@ + # frozen_string_literal: true + class CropPhotoCounterCache < ActiveRecord::Migration[5.2] def change change_table :crops do |t| diff --git a/script/rails b/script/rails index 754b05caa..bb6f9c879 100755 --- a/script/rails +++ b/script/rails @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + # This command will automatically be run when you run "rails" # with Rails 3 gems installed from the root of your application.