Acts_as_ferret 0.5.0 and will_paginate

I was using the current stable version of acts_as_ferret to develop
until I ran into the “Expected x to define Y” bug outlined in

This fixed the problem I was running into in production, however my
multi-model searches are only returning the main model and not any
associated models.

I’ve added this search method into acts_as_ferret:

module ActsAsFerret
module ClassMethods
def paginate_search(query, options = {})
page, per_page, total = wp_parse_options(options)
pager =, per_page, total)
options.merge!(:offset => pager.offset, :limit => per_page)
result = find_with_ferret(query, options)

  returning, per_page,

result.total_hits) do |p|
p.replace result

Additionally, here’s the search query that I use:

@results = Customer.paginate_search("#{@search_string}",
:page => (params[:page] || 1),
:per_page => 10,
:multi => [Address, EmailAddress, PhoneNumber])

Any help would greatly be appreciated.

Thanks in advance,


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs