diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 849bdb11d..d168488b1 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -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 diff --git a/app/models/concerns/search_photos.rb b/app/models/concerns/search_photos.rb index 10c98adf0..1715963a1 100644 --- a/app/models/concerns/search_photos.rb +++ b/app/models/concerns/search_photos.rb @@ -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) }