mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-11 17:24:50 -04:00
Rubcop fix up
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user