#351: small refactoring

This commit is contained in:
Vokhmin Alexey V 2014-02-13 00:10:27 +04:00
parent 7809f755b3
commit a26a44781d
1 changed files with 2 additions and 3 deletions

View File

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