Rubocop lint tidy

This commit is contained in:
Brenda Wallace
2019-02-05 12:37:09 +13:00
parent 9c4e649c5d
commit 6167af700d
4 changed files with 6 additions and 6 deletions

View File

@@ -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) }

View File

@@ -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'

View File

@@ -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

View File

@@ -10,7 +10,7 @@ module Api
has_many :harvests
has_many :photos
has_one :parent
attribute :name