Rubcop fix up

This commit is contained in:
Brenda Wallace
2019-01-04 15:37:35 +13:00
parent 62a8f6b8d3
commit 1e6c204df2
5 changed files with 7 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
class FollowsController < ApplicationController
before_action :authenticate_member!
before_action :set_member, only: [:index, :followers]
before_action :set_member, only: %i(index followers)
load_and_authorize_resource
skip_load_resource only: :create

View File

@@ -9,7 +9,7 @@ class GardensController < ApplicationController
def index
@owner = Member.find_by(slug: params[:member_slug])
@show_all = params[:all] == '1'
@gardens = @gardens.active unless @show_all
@gardens = @gardens.where(owner: @owner) if @owner.present?
@gardens = @gardens.joins(:owner).order(:name).paginate(page: params[:page])

View File

@@ -15,7 +15,7 @@ class HarvestsController < ApplicationController
@harvests = @harvests.where(crop: @crop) if @crop.present?
@harvests = @harvests.where(planting: @planting) if @planting.present?
@harvests = @harvests.order(harvested_at: :desc).joins(:owner, :crop).paginate(page: params[:page])
@filename = csv_filename
respond_with(@harvests)

View File

@@ -110,9 +110,9 @@ class PlantingsController < ApplicationController
def specifics
if @owner
"#{@owner.login_name}-"
elsif @crop
"#{@crop.name}-"
"#{@owner.login_name}-"
elsif @crop
"#{@crop.name}-"
end
end
end

View File

@@ -68,7 +68,7 @@ class SeedsController < ApplicationController
:finished, :finished_at
)
end
def csv_filename
if @owner
"Growstuff-#{@owner}-Seeds-#{Time.zone.now.to_s(:number)}.csv"