effective_addresses 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e67a2c4ca21e0c16b9d61346e05f3533ba09b31
4
- data.tar.gz: 659e413366e47d7c3c8b2469c8c0887f7cbade9a
3
+ metadata.gz: 1e8cba4d12a78d602faee293d07424ef7ef53ec6
4
+ data.tar.gz: a92fde9f620c7219cfe3e904da0543b6971e22e7
5
5
  SHA512:
6
- metadata.gz: 23c02018590042e590c457e702a9178cbbdd34b9f90bfb92bf610e9519cb9067f9212af07d77e4c0aec1ef8f1b9f91010b45c709e1fa890b1b6b4e066ced7025
7
- data.tar.gz: ba069457c8055a65af00fc91fdd77a3a5a55cd54737d211262e38bbaad0551147fe012665bc78122c29799b6eb70ed90a46106a2d7c00335aadd37a1d9960924
6
+ metadata.gz: 5f99a0c80b61790407be9e7ae6d44cf05019bedb366e82cc4fa8e0d3014986d8c5177491a64c4a62b35080bdf6801b8efae126439c9581d5dfa3dea0b6bc5e57
7
+ data.tar.gz: f0e7f9b9ec536ce1e12ec234d3a9369bae7b674fd4e111806af978c57e527c8e66df3d84dc54f20fd072d514faeac0183e71a3122a60ae4e269e1204382f86b3
data/README.md CHANGED
@@ -216,11 +216,17 @@ Add `config/initializer/geocoder.rb`, below is a sample:
216
216
 
217
217
  ```ruby
218
218
  Geocoder.configure(
219
- # geocoding options
220
-
221
- # IP address geocoding service (see below for supported options):
219
+ # Remote IP address geocoding service (see below for supported options):
222
220
  # https://github.com/alexreisner/geocoder#ip-address-services
223
221
  ip_lookup: :telize,
222
+
223
+ # Local IP address file database:
224
+ # 1. gem 'maxminddb'
225
+ # 2. download database: http://dev.maxmind.com/geoip/geoip2/geolite2/
226
+ # 3. save file in db/geocoder
227
+ # ip_lookup: :geoip2,
228
+ # geoip2: { file: File.expand_path('../../db/geocoder/GeoLite2-City.mmdb', File.dirname(__FILE__)) },
229
+
224
230
  cache: Rails.cache,
225
231
  cache_prefix: 'geocoder:'
226
232
  )
@@ -28,11 +28,11 @@ module EffectiveAddressesHelper
28
28
  address.country = EffectiveAddresses.pre_selected_country
29
29
  address.state = EffectiveAddresses.pre_selected_state if (result[0].present? && EffectiveAddresses.pre_selected_state.present?)
30
30
  elsif @@use_geocoder && request.location.present?
31
- data = request.location.data
32
- address.country = data['country_code']
33
- address.state = data['region_code']
34
- address.postal_code = data['postal_code']
35
- address.city = data['city']
31
+ location = request.location
32
+ address.country = location.country_code
33
+ address.state = location.state_code
34
+ address.postal_code = location.postal_code
35
+ address.city = location.city
36
36
  end
37
37
  end
38
38
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveAddresses
2
- VERSION = '1.3.0'.freeze
2
+ VERSION = '1.3.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_addresses
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect