试图了解以下原因:
ree-1.8.7-2011.03 :012 > User.solr_search.results.respond_to?(:total_pages)
=> false
ree-1.8.7-2011.03 :013 > User.solr_search.results.total_pages
=> 624
使用太阳黑子1.3.0时,以太阳黑子搜索对象进行以下委托(我不认为代表团在这种情况下应该重要,但是为了以防万一,我想包括在这里。):
::Sunspot::Search::StandardSearch.class_eval do
include Enumerable
delegate(
:current_page,
:per_page,
:total_entries,
:total_pages,
:offset,
:previous_page,
:next_page,
:out_of_bounds?,
:each,
:in_groups_of,
:blank?,
:[],
:to => :results
)
end