Commit 27390f77 authored by Mario Manno's avatar Mario Manno

fix ransack in conferences_controller, remove remaining acts_as_indexed from reports_controller

parent 9c2885db
......@@ -10,7 +10,7 @@ class ConferencesController < ApplicationController
# GET /conferences
# GET /conferences.xml
def index
result = search Conference, params
result = search params
@conferences = result.paginate page: page_param
respond_to do |format|
......@@ -96,16 +96,16 @@ class ConferencesController < ApplicationController
return "edit"
end
def search(conferences, params)
def search(params)
if params.has_key?(:term) and not params[:term].empty?
term = params[:term]
sort = params[:q][:s] rescue nil
@search = events.ransack(title_cont: term,
@search = Event.ransack(title_cont: term,
acronym_cont: term,
m: 'or',
s: sort)
else
@search = conferences.ransack(params[:q])
@search = Conference.ransack(params[:q])
end
@search.result(distinct: true)
......
......@@ -15,7 +15,7 @@ class ReportsController < ApplicationController
conference_events = @conference.events
if params[:term]
conference_events = @conference.events.with_query(params[:term])
conference_events = @conference.events.ransack(params[:term]).result
end
case @report_type
......@@ -60,7 +60,7 @@ class ReportsController < ApplicationController
conference_people = Person
if params[:term]
conference_people = Person.with_query(params[:term])
conference_people = Person.ransack(params[:term]).result
end
case @report_type
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment