Created
December 18, 2011 20:22
-
-
Save Justinwceo/1494350 to your computer and use it in GitHub Desktop.
geocoder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
searchable do | |
string :search_near | |
location :location do | |
Sunspot::Util::Coordinates.new(store.latitude, store.longitude) if store | |
end | |
end | |
def search_near | |
store.address if store | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
q.with(:location).in_radius(*Geocoder.coordinates(params[:search_near]), 100) if params[:search_near].present? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment