From a26a44781d009cbfa83e80332318fb07edcc8315 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Thu, 13 Feb 2014 00:10:27 +0400 Subject: [PATCH] #351: small refactoring --- app/controllers/advisories_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/advisories_controller.rb b/app/controllers/advisories_controller.rb index 91c031cc8..8106aa8da 100644 --- a/app/controllers/advisories_controller.rb +++ b/app/controllers/advisories_controller.rb @@ -5,9 +5,8 @@ class AdvisoriesController < ApplicationController authorize_resource def index - @advisories = @advisories.scoped(include: :platforms) - @advisories = @advisories.search(params[:q]) if params[:q] - @advisories = @advisories.uniq.paginate(page: params[:page]) + @advisories = @advisories.includes(:platforms).search(params[:q]). + uniq.paginate(page: params[:page]) respond_to do |format| format.html format.atom