mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-24 16:58:35 -04:00
Rubocop lint tidy
This commit is contained in:
@@ -53,7 +53,7 @@ class CropsController < ApplicationController
|
||||
@posts = @crop.posts.order(created_at: :desc).paginate(page: params[:page])
|
||||
|
||||
@photos = Photo.by_crop(@crop)
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render json: @crop.to_json(crop_json_fields) }
|
||||
|
||||
@@ -60,7 +60,7 @@ module PlantingsHelper
|
||||
t 'planting.status.perennial'
|
||||
elsif planting.finished?
|
||||
t 'planting.status.finished'
|
||||
elsif ! planting.finish_is_predicatable?
|
||||
elsif !planting.finish_is_predicatable?
|
||||
t 'planting.status.not_enough_data'
|
||||
elsif planting.harvest_time?
|
||||
t 'planting.status.harvesting'
|
||||
|
||||
@@ -15,9 +15,9 @@ class Photo < ApplicationRecord
|
||||
end
|
||||
|
||||
default_scope { joins(:owner) } # Ensures the owner still exists
|
||||
scope :by_crop, ->(crop) { joins(:photographings).where(photographings: {crop: crop}) }
|
||||
scope :by_model, ->(model_name) { joins(:photographings).where(photographings: {photographable_type: model_name.to_s}) }
|
||||
|
||||
scope :by_crop, ->(crop) { joins(:photographings).where(photographings: { crop: crop }) }
|
||||
scope :by_model, ->(model_name) { joins(:photographings).where(photographings: { photographable_type: model_name.to_s }) }
|
||||
|
||||
# This is split into a side-effect free method and a side-effecting method
|
||||
# for easier stubbing and testing.
|
||||
def flickr_metadata
|
||||
|
||||
@@ -10,7 +10,7 @@ module Api
|
||||
has_many :harvests
|
||||
|
||||
has_many :photos
|
||||
|
||||
|
||||
has_one :parent
|
||||
|
||||
attribute :name
|
||||
|
||||
Reference in New Issue
Block a user