Skip to content

Commit

Permalink
+ location webapp gmaps test
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed Apr 19, 2011
1 parent 93a1a82 commit 1c56b31
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 47 deletions.
2 changes: 1 addition & 1 deletion server/test_project/app/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def initialize isbn

real_geo_index = Index::Memory.new :real_geo do
source Sources::CSV.new(:location, :north, :east, file: 'data/ch.csv', col_sep: ',')
category :location
category :location, partial: Partial::Substring.new(from: 1)
geo_categories :north, :east, 1, precision: 3
end

Expand Down
2 changes: 1 addition & 1 deletion server/test_project/location_webapp/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GEM
kgio (2.3.3)
monkey-lib (0.5.4)
backports
picky-client (2.0.0)
picky-client (2.3.1)
yajl-ruby (>= 0.7.8)
rack (1.2.2)
sinatra (1.2.1)
Expand Down
4 changes: 3 additions & 1 deletion server/test_project/location_webapp/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
# and then populate the result with models (rendered, even).
#
get '/search/full' do
results = Geo.search params[:query], :ids => 20, :offset => params[:offset]
results = Geo.search params[:query], :ids => 100, :offset => params[:offset]
results.extend Picky::Convenience
results[:geo] ||= []
results.populate_with Location do |location|
results[:geo] << [location.north, location.east]
location.to_s
end

Expand Down
Loading

0 comments on commit 1c56b31

Please sign in to comment.