I get DEPRECATION WARNING: #apply_finder_options is deprecated.
when trying this in my user.rb
:
def User.search(search, page)
paginate page: page,
per_page: 10,
conditions: ['name LIKE ?', "%#{search}%"],
order: 'name'
end
Called through UsersController
:
def index
@users = User.search(params[:search], params[:page])
end
The pagination is done with the will_paginate
gem.
What is triggering the warning and how can I fix it? Been trying some googling, but I find the docs not too comprehensive!