rubocop lint fixes

This commit is contained in:
Brenda Wallace
2019-06-16 10:31:03 +12:00
parent 391874e27e
commit ef91e26d28
3 changed files with 3 additions and 7 deletions

View File

@@ -143,7 +143,7 @@ group :development, :test do
gem 'haml-i18n-extractor'
gem 'haml-rails' # HTML templating language
gem 'haml_lint', '>= 0.25.1' # Checks haml files for goodness
gem 'i18n-tasks' # adds tests for finding missing and unused translations
gem 'i18n-tasks' # adds tests for finding missing and unused translations
# gem 'poltergeist' # for headless JS testing
gem 'rspec-activemodel-mocks'
gem 'rspec-rails' # unit testing framework

View File

@@ -3,9 +3,7 @@ class SessionsController < Devise::SessionsController
def create
super do |_resource|
if Crop.pending_approval.present? && current_member.role?(:crop_wrangler)
flash[:alert] = "There are crops waiting to be wrangled."
end
flash[:alert] = "There are crops waiting to be wrangled." if Crop.pending_approval.present? && current_member.role?(:crop_wrangler)
end
end
end

View File

@@ -55,9 +55,7 @@ class Crop < ApplicationRecord
####################################
# Elastic search configuration
if ENV["GROWSTUFF_ELASTICSEARCH"] == "true"
searchkick word_start: %i(name alternate_names scientific_names), case_sensitive: false
end
searchkick word_start: %i(name alternate_names scientific_names), case_sensitive: false if ENV["GROWSTUFF_ELASTICSEARCH"] == "true"
def planting_photos
Photo.joins(:plantings).where("plantings.crop_id": id)