I figured it out...
tmp_dealerships = Dealership.search( make_name,:with => {:makes_id =>
make_id, :disabled => false,"@geodist" =>
last_miles_in_meters..miles_in_meters},:order => "offer_count
desc,time_to_offer asc,@geodist asc",:per_page =>
number_of_dealerships_to_add * 3, :page => 1,:geo =>
[ degrees_to_radians(zip_code.latitude),
degrees_to_radians(zip_code.longitude)]).compact
puts tmp_dealerships.class # Array
changes to this:
tmp_dealerships = Dealership.search( make_name,:with => {:makes_id =>
make_id, :disabled => false,"@geodist" =>
last_miles_in_meters..miles_in_meters},:order => "offer_count
desc,time_to_offer asc,@geodist asc",:per_page =>
number_of_dealerships_to_add * 3, :page => 1,:geo =>
[ degrees_to_radians(zip_code.latitude),
degrees_to_radians(zip_code.longitude)])
puts tmp_dealerships.class # ThinkingSphinx::Search
I was using compact at some point as I was getting empty
values...probably removing entries, but the indexes were still there.
I used compact to remove the entries. Now it seems to be turning the
thinking_sphinx container into an array. I think before it was a
ThinkingSphinx::Collection of something and it worked just fine.
Erik
On Feb 17, 1:38 pm, erik <
e...@carwoo.com> wrote:
> I upgraded to Rails 2.3.8 and thinking_sphinx gem 1.3.11
>
> I was using Rails 2.2.2 and an old thinking_sphinx plugin.
>
> Most things are working fine, but when i try to use each_with_geodist
> I get this error:
> NoMethodError: undefined method `each_with_geodist' for #<Array:
> 0x10c6f9408>
>
> I saw this post about the resolution was to upgrade...
http://groups.google.com/group/thinking-sphinx/tree/browse_frm/month/...