New API for gem browser 2.

This commit is contained in:
Martin Edenhofer 2016-03-01 15:45:33 +01:00
parent ba3f868638
commit 286e1591c6

View file

@ -21,6 +21,11 @@ store device for user
def self.add(user_agent, ip, user_id, fingerprint, type) def self.add(user_agent, ip, user_id, fingerprint, type)
# since gem browser 2 is not handling nil for user_agent, set it to ''
if user_agent.nil?
user_agent = ''
end
# get location info # get location info
location_details = Service::GeoIp.location(ip) location_details = Service::GeoIp.location(ip)
location = 'unknown' location = 'unknown'
@ -49,7 +54,7 @@ store device for user
end end
# get browser details # get browser details
browser = Browser.new(ua: user_agent, accept_language: 'en-us') browser = Browser.new(user_agent, accept_language: 'en-us')
browser = { browser = {
plattform: browser.platform.to_s.camelize, plattform: browser.platform.to_s.camelize,
name: browser.name, name: browser.name,