Skip to content

Commit

Permalink
changing location
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Mar 8, 2018
1 parent 978b107 commit 2b71373
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Empty file added -112.0178286)
Empty file.
8 changes: 4 additions & 4 deletions app/models/listing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -755,9 +755,9 @@ def self.search(params)


if params[:radius].present?
listings = Listing.where(id: listings.near(params[:location],params[:radius]).map{|i| i.id}) if params[:location].present?
listings = Listing.where(id: listings.near(params[:location].upcase,params[:radius]).map{|i| i.id}) if params[:location].present?
else
listings = Listing.where(id: listings.near(params[:location],200).map{|i| i.id}) if params[:location].present?
listings = Listing.where(id: listings.near(params[:location].upcase,200).map{|i| i.id}) if params[:location].present?
end


Expand Down Expand Up @@ -817,9 +817,9 @@ def self.bodysearch(params)


if params[:radius].present?
listings = listings.near(params[:location],params[:radius]) if params[:location].present?
listings = listings.near(params[:location].upcase,params[:radius]) if params[:location].present?
else
listings = listings.near(params[:location],200) if params[:location].present?
listings = listings.near(params[:location].upcase,200) if params[:location].present?
end

listings
Expand Down
Binary file modified dump.rdb
Binary file not shown.

0 comments on commit 2b71373

Please sign in to comment.