Skip to content

Commit

Permalink
GeoNearResults: implement sort_by! if not on ruby 1.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
schnittchen committed Dec 2, 2011
1 parent 32b3a46 commit 81257b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/mongoid_spacial/spacial/geo_near_results.rb
Expand Up @@ -135,6 +135,11 @@ def next_page
self.current_page < self.total_pages ? (self.current_page + 1) : nil
end

if RUBY_VERSION.to_f < 1.9
def sort_by!
replace sort_by { |obj| yield obj }
end
end
end
end
end

0 comments on commit 81257b8

Please sign in to comment.