Created
June 20, 2013 23:07
-
-
Save steveburkett/5827575 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<<<<<<< HEAD | |
def self.update_location_google_places_listing(location, place_details_data) | |
business_listing = location.google_places_listing | |
business_listing.average_rating = place_details_data.result.rating | |
business_listing.url = place_details_data.result.url | |
business_listing.save | |
end | |
# @params Location location the location being updated | |
# @params String search_result the google places search api result, | |
# contains a reference needed for the | |
# subsequent google places details | |
# request for the api call to work. | |
# @return the passed in location | |
def self.update_location_details(location, search_result, params) | |
place_details = perform_places_details_request(search_result) | |
update_location(location, place_details) | |
update_location_address(location, place_details, params) | |
update_location_google_places_listing(location, place_details) | |
location | |
end | |
def self.perform_places_details_request(search_result) | |
client = Middleware::GooglePlaces::Api.new | |
response = client.place_details(search_result["reference"]) | |
Hashie::Mash.new(response) | |
end | |
||||||| merged common ancestors | |
def self.update_location_google_places_listing(location, place_details_data) | |
business_listing = location.business_listings.find_by_reputation_site_id(ReputationSite::GOOGLE_PLACES) | |
business_listing.average_rating = place_details_data.result.rating | |
business_listing.url = place_details_data.result.url | |
business_listing.save | |
end | |
# @params Location location the location being updated | |
# @params String search_result the google places search api result, | |
# contains a reference needed for the | |
# subsequent google places details | |
# request for the api call to work. | |
# @return the passed in location | |
def self.update_location_details(location, search_result, params) | |
place_details = perform_places_details_request(search_result) | |
update_location(location, place_details) | |
update_location_address(location, place_details, params) | |
update_location_google_places_listing(location, place_details) | |
location | |
end | |
def self.perform_places_details_request(search_result) | |
client = Middleware::GooglePlaces::Api.new | |
response = client.place_details(search_result["reference"]) | |
Hashie::Mash.new(response) | |
end | |
======= | |
>>>>>>> master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment