neighborhood 0.1.0 → 0.1.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: a9d37b2adbaa206a5d585a5e05e2754cca94ab66
4
- data.tar.gz: 6c1047694cd6649fa98d6682ed78f429a46edcd2
3
+ metadata.gz: 8ad5b713249be461fcaace159ce33fb8321251f7
4
+ data.tar.gz: 3ff6ec50dc785352c7ff5b503623843b40ee1194
5
5
  SHA512:
6
- metadata.gz: bb33500ab95e932430dbab64c1d43a1325ecf15c5ae5220c47cf6fda823a5c583ade44bfa0485314f3a1860747792d172fa0b35b13ae8a7fcb94f8b0448b9d2d
7
- data.tar.gz: db438c434e5e967b9924d559d18d2ebe02dcc0c22213486d2c0b231091575cc97386b1c822d9166c32aabc2ee31bd9b08b64a214c5da7c3d9dacacbdfaf2940c
6
+ metadata.gz: 9b5a9ffe1a57dd2b8be8fda8088ff36fc6f1cf81eb240fe01bbe84f4195c5b01d1e0e42894a81b08e4533c7399741219416f589d8c4e6412a425d28fa3ef0b3b
7
+ data.tar.gz: 7b0f281620cff0dd980dc10ead3ded7f864e48a23b7d44bd892691bc632c17d1aefdd04bd484dd390bbf3a023b58c0403bcaa399a5afd73680aad73f20df6748
@@ -2,7 +2,7 @@ require 'geocoder'
2
2
 
3
3
  class << ActiveRecord::Base
4
4
 
5
- def in_the_neighborhood
5
+ def in_the_neighborhood(options = {})
6
6
  geocoded_by :address, :latitude => :lat, :longitude => :lng
7
7
 
8
8
  after_validation :geocode_if_address
@@ -23,9 +23,11 @@ class << ActiveRecord::Base
23
23
  :full_address => geo['formatted_address'],
24
24
  }
25
25
  # set country if necessary
26
- country = geo['address_components']
27
- .select { |a| a['types'].include?('country') }.first['long_name']
28
- attrs[:country] = country if country.present?
26
+ unless options[:autoset_country] == false
27
+ country = geo['address_components']
28
+ .select { |a| a['types'].include?('country') }.first['long_name']
29
+ attrs[:country] = country if country.present?
30
+ end
29
31
  # save attributes
30
32
  update_columns(attrs)
31
33
  end
@@ -1,3 +1,3 @@
1
1
  module Neighborhood
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neighborhood
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean C Davis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-28 00:00:00.000000000 Z
11
+ date: 2015-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler