mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-13 02:35:22 -04:00
[CodeFactor] Apply fixes
This commit is contained in:
@@ -16,17 +16,17 @@ class PhotosController < ApplicationController
|
||||
where = {}
|
||||
if params[:crop_slug]
|
||||
@crop = Crop.find params[:crop_slug]
|
||||
where = { crop_id: @crop.id}
|
||||
where = { crop_id: @crop.id }
|
||||
elsif params[:planting_id]
|
||||
@planting = Planting.find params[:planting_id]
|
||||
where = { planting_id: @planting.id}
|
||||
where = { planting_id: @planting.id }
|
||||
end
|
||||
|
||||
@photos = Photo.search(load: false,
|
||||
boost_by: [:created_at],
|
||||
where: where,
|
||||
page: params[:page],
|
||||
limit: 50)
|
||||
boost_by: [:created_at],
|
||||
where: where,
|
||||
page: params[:page],
|
||||
limit: 50)
|
||||
respond_with(@photos)
|
||||
end
|
||||
|
||||
|
||||
@@ -5,13 +5,12 @@ module SearchPhotos
|
||||
|
||||
included do
|
||||
searchkick merge_mappings: true,
|
||||
mappings: {
|
||||
properties: {
|
||||
title: { type: :text },
|
||||
created_at: { type: :integer },
|
||||
}
|
||||
}
|
||||
|
||||
mappings: {
|
||||
properties: {
|
||||
title: { type: :text },
|
||||
created_at: { type: :integer }
|
||||
}
|
||||
}
|
||||
|
||||
# scope :search_import, -> { includes(:owner, :crops, :plantings, :harvests, :seeds, :posts) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user